
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <link rel="canonical" href="https://blog.csdn.net/qq_44034384/article/details/107044216"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="report" content='{"pid": "blog", "spm":"1001.2101"}'>
    <meta name="referrer" content="always">
    <meta http-equiv="Cache-Control" content="no-siteapp" /><link rel="alternate" media="handheld" href="#" />
    <meta name="shenma-site-verification" content="5a59773ab8077d4a62bf469ab966a63b_1497598848">
    <meta name="applicable-device" content="pc">
    <link  href="https://g.csdnimg.cn/static/logo/favicon32.ico"  rel="shortcut icon" type="image/x-icon" />
    <title>深入浅出Python——Python基础语法全解_路虽远，行则必至！-CSDN博客_深入浅出python</title>
    <script>
      (function(){ 
        var el = document.createElement("script"); 
        el.src = "https://s3a.pstatp.com/toutiao/push.js?1abfa13dfe74d72d41d83c86d240de427e7cac50c51ead53b2e79d40c7952a23ed7716d05b4a0f683a653eab3e214672511de2457e74e99286eb2c33f4428830"; 
        el.id = "ttzz"; 
        var s = document.getElementsByTagName("script")[0]; 
        s.parentNode.insertBefore(el, s);
      })(window)
    </script>
        <meta name="keywords" content="深入浅出python">
        <meta name="csdn-baidu-search"  content='{"autorun":true,"install":true,"keyword":"深入浅出python"}'>
    <meta name="description" content="前言：Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。文章目录一、Python简介1. 了解Python2. Python介绍3. Python特点4. Python发展历史5. Python版本二、Python解释器1. 解释器的作用2. 解释器的安装三、PyCharm安装与使用1. PyCharm的作用2. PyCharm安装与使用四、注释1. 注释的作用2. 注释的分类及语法五、变量1. 变量的作用2. 定义变量2.1 标识符2.2 命名习惯2.3 使用变量2.4 认识">
    <script src='//g.csdnimg.cn/tingyun/1.8.3/blog.js' type='text/javascript'></script>
        <link rel="stylesheet" type="text/css" href="https://csdnimg.cn/release/blogv2/dist/pc/css/detail_enter-7eae656c78.min.css">
    <script type="application/ld+json">{"@context":"https://ziyuan.baidu.com/contexts/cambrian.jsonld","@id":"https://blog.csdn.net/qq_44034384/article/details/107044216","appid":"1638831770136827","pubDate":"2020-07-24T20:31:37","title":"深入浅出Python&mdash;&mdash;Python基础语法全解_路虽远，行则必至！-CSDN博客_深入浅出python","upDate":"2020-07-24T20:31:37"}</script>
        <link rel="stylesheet" type="text/css" href="https://csdnimg.cn/release/blogv2/dist/pc/themesSkin/skin-growway/skin-growway-d937252ffc.min.css">
    <script src="https://csdnimg.cn/public/common/libs/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var isCorporate = false;//注释删除enterprise
        var username =  "qq_44034384";
        var skinImg = "white";
        var blog_address = "https://luckylifes.blog.csdn.net";
        var currentUserName = "";
        var isOwner = false;
        var loginUrl = "http://passport.csdn.net/account/login?from=https://blog.csdn.net/qq_44034384/article/details/107044216";
        var blogUrl = "https://blog.csdn.net/";
        var avatar = "https://profile.csdnimg.cn/5/C/1/3_qq_44034384";
        var articleTitle = "深入浅出Python——Python基础语法全解";
        var articleDesc = "前言：Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。文章目录一、Python简介1. 了解Python2. Python介绍3. Python特点4. Python发展历史5. Python版本二、Python解释器1. 解释器的作用2. 解释器的安装三、PyCharm安装与使用1. PyCharm的作用2. PyCharm安装与使用四、注释1. 注释的作用2. 注释的分类及语法五、变量1. 变量的作用2. 定义变量2.1 标识符2.2 命名习惯2.3 使用变量2.4 认识";
        var articleTitles = "深入浅出Python——Python基础语法全解_路虽远，行则必至！-CSDN博客_深入浅出python";
        var nickName = "不染-何程龙";
        var articleDetailUrl = "https://luckylifes.blog.csdn.net/article/details/107044216";
        if(window.location.host.split('.').length == 3) {
            blog_address = blogUrl + username;
        }
        var skinStatus = "White";
        var blogStaticHost = "https://csdnimg.cn/release/blogv2/"
    </script>
    <script src="https://g.csdnimg.cn/??fixed-sidebar/1.1.6/fixed-sidebar.js" type="text/javascript"></script>
    <script src='//g.csdnimg.cn/common/csdn-report/report.js' type='text/javascript'></script>
    <link rel="stylesheet" type="text/css" href="https://csdnimg.cn/public/sandalstrap/1.4/css/sandalstrap.min.css">
    <style>
        .MathJax, .MathJax_Message, .MathJax_Preview{
            display: none
        }
    </style>
    <script src="https://dup.baidustatic.com/js/ds.js"></script>
</head>
<body class="nodata " style="">
        <script>
            var toolbarSearchExt = '{"landingWord":["深入浅出python"],"queryWord":"python","tag":["python","基础语法","流程控制","数据序列","知识总结"],"title":"深入浅出Python——Python基础语法全解"}';
        </script>
    <script src="https://g.csdnimg.cn/common/csdn-toolbar/csdn-toolbar.js" type="text/javascript"></script>
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
    </script>
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/pc/css/blog_code-01256533b5.min.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/chart-3456820cac.css" />
<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
    <div class="container clearfix" id="mainBox">
        <main>
<script type="text/javascript">
    var blogSensitiveWords = "";
    function getQueryString(name) {   
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象  
      var r = window.location.search.substr(1).match(reg);  //匹配目标参数
      if( r != null ) return decodeURIComponent( r[2] ); return '';   
    }
    function stripscript(s){ 
      var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？%]") 
      var rs = ""; 
      for (var i = 0; i < s.length; i++) { 
        rs = rs+s.substr(i, 1).replace(pattern, ''); 
      } 
      return rs; 
    }
    var blogHotWords = stripscript(getQueryString('utm_term')).length > 1 ? stripscript(getQueryString('utm_term')) : ''
</script>
<div class="blog-content-box">
    <div class="article-header-box">
        <div class="article-header">
            <div class="article-title-box">
                <h1 class="title-article" id="articleContentId">深入浅出Python——Python基础语法全解</h1>
            </div>
            <div class="article-info-box">
                <div class="article-bar-top">
                    <img class="article-type-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/original.png" alt="">
                    <div class="bar-content">
                        <span class="c-gray">置顶</span>
                    <a class="follow-nickName " href="https://luckylifes.blog.csdn.net" target="_blank" rel="noopener">不染-何程龙</a>
                    <span class="time">2020-07-24 20:31:37</span>
                    <img class="article-read-img article-heard-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/articleReadEyes.png" alt="">
                    <span class="read-count">22236</span>
                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click='{"mod":"popu_823","spm":"1001.2101.3001.4232","ab":"new"}'>
                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollect.png" alt="">
                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollectionActive.png" alt="">
                        <span class="name">收藏</span>
                        <span class="get-collection">
                            1415
                        </span>
                    </a>
                    </div>
                </div>
                <div class="blog-tags-box">
                    <div class="tags-box artic-tag-box">
                            <span class="label">分类专栏：</span>
                                <a class="tag-link" href="https://blog.csdn.net/qq_44034384/category_10189881.html" target="_blank" rel="noopener">Python</a>
                            <span class="label">文章标签：</span>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"python","ab":"new"}' class="tag-link" href="https://www.csdn.net/tags/MtjaQg4sNDk0LWJsb2cO0O0O.html" target="_blank" rel="noopener">python</a>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"基础语法","ab":"new"}' class="tag-link" href="https://www.csdn.net/tags/MtTaEg0sMzM2MzMtYmxvZwO0O0OO0O0O.html" target="_blank" rel="noopener">基础语法</a>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"流程控制","ab":"new"}' class="tag-link" href="https://www.csdn.net/tags/MtTaEg0sMTYzMjYtYmxvZwO0O0OO0O0O.html" target="_blank" rel="noopener">流程控制</a>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"数据序列","ab":"new"}' class="tag-link" href="https://so.csdn.net/so/search/s.do?q=数据序列&t=blog&o=vip&s=&l=&f=&viparticle=" target="_blank" rel="noopener">数据序列</a>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"知识总结","ab":"new"}' class="tag-link" href="https://so.csdn.net/so/search/s.do?q=知识总结&t=blog&o=vip&s=&l=&f=&viparticle=" target="_blank" rel="noopener">知识总结</a>
                    </div>
                </div>
                <div class="up-time"><span>最后发布:2020-07-24 20:31:37</span><span>首次发布:2020-07-24 20:31:37</span></div>
                <div class="slide-content-box">
                    <div class="article-copyright">
                        <div class="creativecommons">
                            版权声明：本文为博主原创文章，遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议，转载请附上原文出处链接和本声明。
                        </div>
                        <div class="article-source-link">
                            本文链接：<a href="https://blog.csdn.net/qq_44034384/article/details/107044216" target="_blank">https://blog.csdn.net/qq_44034384/article/details/107044216</a>
                        </div>
                    </div>
                </div>
                <div class="operating">
                    <a class="href-article-edit slide-toggle">版权</a>
                </div>
            </div>
        </div>
    </div>
    <article class="baidu_pl">
        <div id="article_content" class="article_content clearfix">
        <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-b5506197d8.css">
                <div id="content_views" class="markdown_views prism-atom-one-light">
                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
                    </svg>
                    <p>前言&#xff1a;</p> 
<ol><li>Python是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。</li><li>本博文主要涉及Python基础入门、流程控制&#xff08;条件语句、循环语句&#xff09;、数据序列等知识。</li><li>本博文若存在任何知识错误&#xff0c;请读者第一时间在评论区指出&#xff0c;方便我修正内容&#xff01;</li><li>获取更多内容&#xff0c;请关注博主&#xff0c;在主页进行阅读&#xff0c;感谢您的支持&#xff01;</li></ol> 
<p></p>
<div class="toc">
 <h3>文章目录</h3>
 <ul><li><ul><li><a href="#Python_8">一、Python简介</a></li><li><ul><li><a href="#1_Python_9">1. 了解Python</a></li><li><a href="#2_Python_13">2. Python介绍</a></li><li><a href="#3_Python_28">3. Python特点</a></li><li><a href="#4_Python_41">4. Python发展历史</a></li><li><a href="#5_Python_45">5. Python版本</a></li></ul>
   </li><li><a href="#Python_50">二、Python解释器</a></li><li><ul><li><a href="#1__51">1. 解释器的作用</a></li><li><a href="#2__63">2. 解释器的安装</a></li></ul>
   </li><li><a href="#PyCharm_67">三、PyCharm安装与使用</a></li><li><ul><li><a href="#1_PyCharm_68">1. PyCharm的作用</a></li><li><a href="#2_PyCharm_79">2. PyCharm安装与使用</a></li></ul>
   </li><li><a href="#_82">四、注释</a></li><li><ul><li><a href="#1__83">1. 注释的作用</a></li><li><a href="#2__85">2. 注释的分类及语法</a></li></ul>
   </li><li><a href="#_118">五、变量</a></li><li><ul><li><a href="#1__120">1. 变量的作用</a></li><li><a href="#2__129">2. 定义变量</a></li><li><ul><li><a href="#21__136">2.1 标识符</a></li><li><a href="#22__145">2.2 命名习惯</a></li><li><a href="#23__151">2.3 使用变量</a></li><li><a href="#24_bug_160">2.4 认识bug</a></li><li><a href="#25_Debug_162">2.5 Debug工具</a></li></ul>
   </li></ul>
   </li><li><a href="#_170">六、数据类型</a></li><li><a href="#_210">七、输出</a></li><li><ul><li><a href="#1__221">1. 格式化输出</a></li><li><a href="#2_format_240">2. 内置函数format</a></li><li><a href="#3_f_242">3. f-格式化字符串</a></li><li><a href="#4__245">4. 体验格式化字符串</a></li><li><a href="#5__278">5. 补充知识</a></li><li><a href="#6__285">6. 转义字符</a></li><li><a href="#7__289">7. 结束符</a></li></ul>
   </li><li><a href="#_302">八、输入</a></li><li><ul><li><a href="#1__305">1. 输入的语法</a></li><li><a href="#2__310">2. 输入的特点</a></li></ul>
   </li><li><a href="#_323">九、转换数据类型</a></li><li><ul><li><a href="#1__324">1. 转换数据类型的作用</a></li><li><a href="#2__328">2. 转换数据类型的函数</a></li><li><a href="#3__345">3. 体验转换数据类型</a></li></ul>
   </li><li><a href="#_392">十、运算符</a></li><li><ul><li><a href="#1__393">1. 运算符的分类</a></li><li><a href="#2__399">2. 算数运算符</a></li><li><a href="#3__413">3. 赋值运算符</a></li><li><a href="#4__439">4. 复合赋值运算符</a></li><li><a href="#5__466">5. 比较运算符</a></li><li><a href="#6__487">6. 逻辑运算符</a></li><li><a href="#7__503">7. 补充知识</a></li></ul>
   </li><li><a href="#_524">十一、条件语句</a></li><li><ul><li><a href="#1__525">1. 了解条件语句</a></li><li><a href="#2_if_528">2. if语法</a></li><li><ul><li><a href="#21_if_535">2.1 体验if语句</a></li><li><a href="#22__546">2.2 简单版&#xff1a;网吧上网</a></li><li><a href="#23__556">2.3 进阶版&#xff1a;网吧上网</a></li></ul>
    </li><li><a href="#3_ifelse_569">3. if...else...</a></li><li><ul><li><a href="#31__584">3.1 实用版&#xff1a;网吧上网</a></li></ul>
    </li><li><a href="#4__598">4. 多重判断</a></li><li><ul><li><a href="#41__617">4.1 实例&#xff1a;工龄判断</a></li></ul>
    </li><li><a href="#5_if_630">5. if嵌套</a></li><li><ul><li><a href="#51__645">5.1 实例&#xff1a;坐公交</a></li><li><a href="#52_if_683">5.2 if嵌套执行流程</a></li></ul>
    </li><li><a href="#6__685">6. 应用&#xff1a;猜拳游戏</a></li><li><ul><li><a href="#61__722">6.1 初始版&#xff1a;猜拳游戏</a></li><li><a href="#62__755">6.2 进阶版&#xff1a;猜拳游戏</a></li></ul>
    </li><li><a href="#7___809">7. 三目运算符</a></li></ul>
   </li><li><a href="#_827">十二、循环简介</a></li><li><ul><li><a href="#1___828">1. 循环的作用</a></li><li><a href="#2___831">2. 循环的分类</a></li><li><a href="#3_while_834">3. while的语法</a></li><li><a href="#4_while_842">4. while循环快速体验</a></li><li><a href="#5_while_856">5. while的应用</a></li><li><ul><li><a href="#51_1100_857">5.1 应用一&#xff1a;计算1-100累加和</a></li><li><a href="#52_1100_872">5.2 应用二&#xff1a;计算1-100偶数累加和</a></li></ul>
    </li><li><a href="#6_breakcontinue_905">6. break和continue</a></li><li><ul><li><a href="#61__908">6.1 理解</a></li><li><a href="#62_break_914">6.2 break实例</a></li><li><a href="#63_continue_926">6.3 continue实例</a></li></ul>
    </li><li><a href="#7_while_940">7. while循环嵌套</a></li><li><ul><li><a href="#71__941">7.1 语法</a></li><li><a href="#72__953">7.2 执行过程</a></li><li><a href="#73_while_956">7.3 while循环嵌套应用</a></li></ul>
    </li><li><a href="#8_for_1006">8. for循环</a></li><li><ul><li><a href="#81__1007">8.1 语法</a></li><li><a href="#82__1015">8.2 快速体验</a></li><li><a href="#83_break_1023">8.3 break</a></li><li><a href="#84_continue_1034">8.4 continue</a></li></ul>
   </li></ul>
   </li><li><a href="#else_1045">十三、else</a></li><li><ul><li><a href="#1_whileelse_1047">1. while...else</a></li><li><ul><li><a href="#11__1048">1.1 语法</a></li><li><a href="#12__1055">1.2 示例</a></li><li><a href="#13__1066">1.3 退出循环的方式</a></li></ul>
    </li><li><a href="#2_forelse_1099">2. for...else</a></li><li><ul><li><a href="#21__1100">2.1 语法</a></li><li><a href="#22__1111">2.2 示例</a></li><li><a href="#23__1121">2.3 退出循环的方式</a></li></ul>
   </li></ul>
   </li><li><a href="#_1152">十四、字符串</a></li><li><ul><li><a href="#1__1153">1. 认识字符串</a></li><li><a href="#2__1164">2. 字符串特征</a></li><li><a href="#3__1190">3. 字符串输出</a></li><li><a href="#4__1199">4. 字符串输入</a></li><li><a href="#5__1212">5. 下标</a></li><li><ul><li><a href="#51__1213">5.1 概念</a></li><li><a href="#52__1216">5.2 快速体验</a></li></ul>
    </li><li><a href="#6__1234">6. 切片</a></li><li><ul><li><a href="#61__1236">6.1 语法</a></li><li><a href="#62__1246">6.2 示例</a></li></ul>
    </li><li><a href="#7__1261">7. 常用操作方法</a></li><li><ul><li><a href="#71__1263">7.1 查找</a></li><li><a href="#72__1323">7.2 修改</a></li><li><a href="#73__1450">7.3 判断</a></li></ul>
   </li></ul>
   </li><li><a href="#_1532">十五、列表</a></li><li><ul><li><a href="#1__1533">1. 列表的格式</a></li><li><a href="#2__1538">2. 列表的常用操作</a></li><li><ul><li><a href="#21__1540">2.1 查找</a></li><li><a href="#22__1578">2.2 判断是否存在</a></li><li><a href="#22__1601">2.2 增加</a></li><li><a href="#23__1669">2.3 删除</a></li><li><a href="#24__1734">2.4 修改</a></li><li><a href="#25__1771">2.5 复制</a></li></ul>
    </li><li><a href="#3__1782">3. 列表的循环遍历</a></li><li><ul><li><a href="#31_while_1784">3.1 while</a></li><li><a href="#32_for_1794">3.2 for</a></li></ul>
    </li><li><a href="#4__1802">4. 列表嵌套</a></li></ul>
   </li><li><a href="#_1820">十六、元组</a></li><li><ul><li><a href="#1__1822">1. 定义元组</a></li><li><a href="#2__1844">2. 元组的常见操作</a></li><li><a href="#3__1871">3. 元组的注意事项</a></li></ul>
   </li><li><a href="#_1888">十七、字典</a></li><li><ul><li><a href="#1__1890">1. 创建字典的语法</a></li><li><a href="#2__1909">2. 字典常见操作</a></li><li><ul><li><a href="#21__1910">2.1 增</a></li><li><a href="#22__1928">2.2 删</a></li><li><a href="#23__1947">2.3 改</a></li><li><a href="#24__1951">2.4 查</a></li></ul>
    </li><li><a href="#3__1992">3. 字典的循环遍历</a></li><li><ul><li><a href="#31_key_1993">3.1 遍历字典的key</a></li><li><a href="#32_value_2000">3.2 遍历字典的value</a></li><li><a href="#33__2007">3.3 遍历字典的元素</a></li><li><a href="#34__2014">3.4 遍历字典的键值对</a></li></ul>
   </li></ul>
   </li><li><a href="#_2021">十八、集合</a></li><li><ul><li><a href="#1__2023">1. 创建集合</a></li><li><a href="#2__2047">2. 集合常见操作方法</a></li><li><ul><li><a href="#21__2048">2.1 增加数据</a></li><li><a href="#22__2070">2.2 删除数据</a></li><li><a href="#23__2109">2.3 查找数据</a></li></ul>
   </li></ul>
   </li><li><a href="#_2120">十九、公共操作</a></li><li><ul><li><a href="#1__2121">1. 运算符</a></li><li><ul><li><a href="#11__2129">1.1 &#43;</a></li><li><a href="#12__2151">1.2 *</a></li><li><a href="#13_innot_in_2165">1.3 in或not in</a></li></ul>
    </li><li><a href="#2__2182">2. 公共方法</a></li><li><ul><li><a href="#21_len_2191">2.1 len()</a></li><li><a href="#22_del_2214">2.2 del()</a></li><li><a href="#23_max_2227">2.3 max()</a></li><li><a href="#24_min_2238">2.4 min()</a></li><li><a href="#25_range_2249">2.5 range()</a></li><li><a href="#26_enumerate_2266">2.6 enumerate()</a></li></ul>
    </li><li><a href="#3__2284">3. 容器类型转换</a></li><li><ul><li><a href="#31_tuple_2285">3.1 tuple()</a></li><li><a href="#32_list_2295">3.2 list()</a></li><li><a href="#33_set_2305">3.3 set()</a></li></ul>
   </li></ul>
   </li><li><a href="#_2319">二十、推导式</a></li><li><ul><li><a href="#1__2320">1. 列表推导式</a></li><li><ul><li><a href="#11__2325">1.1 快速体验</a></li><li><a href="#12_if_2358">1.2 带if的列表推导式</a></li><li><a href="#13_for_2373">1.3 多个for循环实现列表推导式</a></li></ul>
    </li><li><a href="#2__2385">2. 字典推导式</a></li><li><ul><li><a href="#21__2387">2.1 快速体验</a></li></ul>
    </li><li><a href="#3__2416">3. 集合推导式</a></li></ul>
  </li></ul>
 </li></ul>
</div>
<p></p> 
<h2><a id="Python_8"></a>一、Python简介</h2> 
<h3><a id="1_Python_9"></a>1. 了解Python</h3> 
<p>Python是一种解释型&#xff08;这意味着开发过程中没有了编译这个环节&#xff09;、面向对象&#xff08;支持面向对象的风格或代码封装在对象的编程技术&#xff09;、动态数据类型的交互式&#xff08;可在命令行中通过Python提示符及直接代码执行程序&#xff09;高级程序设计语言。<br /> <img src="https://img-blog.csdnimg.cn/20200630181125144.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h3><a id="2_Python_13"></a>2. Python介绍</h3> 
<p>Python是时下最流行、最火爆的编程语言&#xff0c;具体原因&#xff1a;</p> 
<ul><li>简单、易学&#xff0c;适应人群广泛<br /> <img src="https://img-blog.csdnimg.cn/20200630160133585.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></li><li>免费、开源</li><li>应用领域广泛<br /> <img src="https://img-blog.csdnimg.cn/20200630160612457.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></li></ul> 
<blockquote> 
 <p>备注&#xff1a;以下知名框架均是Python语言开发。</p> 
 <ol><li>Google开源机器学习框架&#xff1a;TensorFlow</li><li>开源社区主推学习框架&#xff1a;Scikit-learn</li><li>百度开源深度学习框架&#xff1a;Paddle</li></ol> 
</blockquote> 
<h3><a id="3_Python_28"></a>3. Python特点</h3> 
<ol><li>易于学习&#xff1a;Python有相对较少的关键字&#xff0c;结构简单&#xff0c;和一个明确定义的语法&#xff0c;学习起来更加简单。</li><li>易于阅读&#xff1a;Python代码定义的更清晰。</li><li>易于维护&#xff1a;Python的成功在于它的源代码是相当容易维护的。</li><li>一个广泛的标准库&#xff1a;Python的最大的优势之一是丰富的库&#xff0c;跨平台的&#xff0c;在UNIX&#xff0c;Windows和Macintosh兼容很好。</li><li>互动模式&#xff1a;互动模式的支持&#xff0c;您可以从终端输入执行代码并获得结果的语言&#xff0c;互动的测试和调试代码片断。</li><li>可移植&#xff1a;基于其开放源代码的特性&#xff0c;Python已经被移植&#xff08;也就是使其工作&#xff09;到许多平台。</li><li>可扩展&#xff1a;如果你需要一段运行很快的关键代码&#xff0c;或者是想要编写一些不愿开放的算法&#xff0c;你可以使用C或C&#43;&#43;完成那部分程序&#xff0c;然后从你的Python程序中调用。</li><li>数据库&#xff1a;Python提供所有主要的商业数据库的接口。</li><li>GUI编程&#xff1a;Python支持GUI可以创建和移植到许多系统调用。</li><li>可嵌入: 你可以将Python嵌入到C/C&#43;&#43;程序&#xff0c;让你的程序的用户获得&#34;脚本化&#34;的能力。</li></ol> 
<h3><a id="4_Python_41"></a>4. Python发展历史</h3> 
<p>Python发展历史&#xff1a;<a href="https://baike.baidu.com/item/Python/407313?fr&#61;aladdin">https://baike.baidu.com/item/Python/407313?fr&#61;aladdin</a></p> 
<h3><a id="5_Python_45"></a>5. Python版本</h3> 
<ul><li>Python 2.X</li><li>Python 3.X</li></ul> 
<h2><a id="Python_50"></a>二、Python解释器</h2> 
<h3><a id="1__51"></a>1. 解释器的作用</h3> 
<ul><li> <p>Python解释器作用&#xff1a;运行文件</p> </li><li> <p>Python解释器种类</p> 
  <ol><li>CPython&#xff0c;C语言开发的解释器[官方]&#xff0c;应用广泛的解释器。</li><li>IPython&#xff0c;基于CPython的一种交互式解释器。</li><li>其他解释器 
    <ul><li>PyPy&#xff0c;基于Python语言开发的解释器。</li><li>Jython&#xff0c;运行在Java平台的解释器&#xff0c;直接把Python代码编译成Java字节码执行。</li><li>IronPython&#xff0c;运行在微软.Net平台上的Python解释器&#xff0c;可以直接把Python代码编译成.Net的字节码。</li></ul> </li></ol> </li></ul> 
<h3><a id="2__63"></a>2. 解释器的安装</h3> 
<p>Python解释器的安装&#xff1a;<a href="https://blog.csdn.net/weixin_43495473/article/details/103559812">https://blog.csdn.net/weixin_43495473/article/details/103559812</a></p> 
<h2><a id="PyCharm_67"></a>三、PyCharm安装与使用</h2> 
<h3><a id="1_PyCharm_68"></a>1. PyCharm的作用</h3> 
<p>PyCharm是一种Python <mark>IDE</mark>&#xff08;集成开发环境&#xff09;&#xff0c;带有一整套可以帮助用户在使用Python语言开发时<mark>提高其效率的工具</mark>&#xff0c;内部集成的功能如下&#xff1a;</p> 
<ul><li>Project管理</li><li>智能提示</li><li>语法高亮</li><li>代码跳转</li><li>调试代码</li><li>解释代码(解释器)</li><li>框架和库</li><li>…</li></ul> 
<h3><a id="2_PyCharm_79"></a>2. PyCharm安装与使用</h3> 
<p>PyCharm的安装&#xff1a;<a href="https://blog.csdn.net/weixin_43495473/article/details/103560198">https://blog.csdn.net/weixin_43495473/article/details/103560198</a></p> 
<h2><a id="_82"></a>四、注释</h2> 
<h3><a id="1__83"></a>1. 注释的作用</h3> 
<p>通过用自己熟悉的语言&#xff0c;在程序中对某些代码进行标注说明&#xff0c;这就是注释的作用&#xff0c;能够大大增强程序的可读性。</p> 
<h3><a id="2__85"></a>2. 注释的分类及语法</h3> 
<p>注释分为两类&#xff1a;<mark>单行注释</mark> 和 <mark>多行注释</mark>。</p> 
<ul><li>单行注释</li></ul> 
<p>只能注释一行内容&#xff0c;语法如下&#xff1a;</p> 
<pre><code class="prism language-python"><span class="token comment"># 注释内容</span>
</code></pre> 
<ul><li>多行注释</li></ul> 
<p>可以注释多行内容&#xff0c;一般用在注释一段代码的情况&#xff0c; 语法如下&#xff1a;</p> 
<pre><code class="prism language-python"><span class="token triple-quoted-string string">&#34;&#34;&#34;
	第一行注释
	第二行注释
	第三行注释
&#34;&#34;&#34;</span>

<span class="token triple-quoted-string string">&#39;&#39;&#39;
	注释1
	注释2
	注释3
&#39;&#39;&#39;</span>
</code></pre> 
<blockquote> 
 <p>快捷键&#xff1a; <mark>ctrl &#43; /</mark></p> 
</blockquote> 
<p><strong>注意&#xff1a;解释器不执行任何的注释内容。</strong></p> 
<h2><a id="_118"></a>五、变量</h2> 
<h3><a id="1__120"></a>1. 变量的作用</h3> 
<p>变量&#xff0c;简单来说&#xff0c;其实就是计算机内存中的一块储存空间&#xff0c;用来存储CPU需要使用的数据。 而这个储存空间需要一个名字&#xff0c;这个名字的统称就叫变量。<br /> <img src="https://img-blog.csdnimg.cn/20200630164812899.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /><br /> 作用&#xff1a;</p> 
<ol><li>用来临时保存数据</li><li>便于项目的后期升级维护</li><li>节约内存</li></ol> 
<h3><a id="2__129"></a>2. 定义变量</h3> 
<pre><code class="prism language-python">变量名 <span class="token operator">&#61;</span> 值
</code></pre> 
<p><strong>变量名自定义&#xff0c;要满足<mark>标识符</mark>命名规则。</strong></p> 
<h4><a id="21__136"></a>2.1 标识符</h4> 
<p>标识符命名规则是Python中定义各种名字的时候的统一规范&#xff0c;具体如下&#xff1a;</p> 
<ul><li>由数字、字母、下划线组成</li><li>不能数字开头</li><li>不能使用内置关键字</li><li>严格区分大小写</li></ul> 
<p><img src="https://img-blog.csdnimg.cn/20200630165207881.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h4><a id="22__145"></a>2.2 命名习惯</h4> 
<ul><li>见名知义。</li><li>大驼峰&#xff1a;即每个单词首字母都大写&#xff0c;例如&#xff1a;<code>MyName</code>。</li><li>小驼峰&#xff1a;第二个&#xff08;含&#xff09;以后的单词首字母大写&#xff0c;例如&#xff1a;<code>myName</code>。</li><li>下划线&#xff1a;例如&#xff1a;<code>my_name</code>。</li></ul> 
<h4><a id="23__151"></a>2.3 使用变量</h4> 
<pre><code class="prism language-python">my_name <span class="token operator">&#61;</span> <span class="token string">&#34;张三&#34;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>my_name<span class="token punctuation">)</span>

myAge <span class="token operator">&#61;</span> <span class="token number">23</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>myAge<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="24_bug_160"></a>2.4 认识bug</h4> 
<p>所谓bug&#xff0c;就是程序中的错误。如果程序有错误&#xff0c;需要程序员排查问题&#xff0c;纠正错误。</p> 
<h4><a id="25_Debug_162"></a>2.5 Debug工具</h4> 
<p>Debug工具是PyCharm IDE中集成的用来调试程序的工具&#xff0c;在这里程序员可以查看程序的执行细节和流程或者调解bug。</p> 
<p>Debug工具使用步骤&#xff1a;</p> 
<ol><li>打断点</li><li>Debug调试</li></ol> 
<h2><a id="_170"></a>六、数据类型</h2> 
<p><strong>在 Python 里为了应对不同的业务需求&#xff0c;也把数据分为不同的类型。</strong></p> 
<p><img src="https://img-blog.csdnimg.cn/20200630165739123.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<blockquote> 
 <p>检测数据类型的方法&#xff1a;<code>type(变量名或者数值)</code></p> 
</blockquote> 
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;int&#39;&gt; -- 整型</span>

b <span class="token operator">&#61;</span> <span class="token number">1.1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;float&#39;&gt; -- 浮点型</span>

c <span class="token operator">&#61;</span> <span class="token boolean">True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;bool&#39;&gt; -- 布尔型</span>

d <span class="token operator">&#61;</span> <span class="token string">&#34;12345&#34;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>d<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;str&#39;&gt; -- 字符串</span>

e <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>e<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;list&#39;&gt; -- 列表</span>

f <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>f<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;tuple&#39;&gt; -- 元组</span>

h <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>h<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;set&#39;&gt; -- 集合</span>

g <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#34;name&#34;</span><span class="token punctuation">:</span> <span class="token string">&#34;张三&#34;</span><span class="token punctuation">,</span> <span class="token string">&#34;age&#34;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>g<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># &lt;class &#39;dict&#39;&gt; -- 字典</span>
</code></pre> 
<p>思考&#xff1a;</p> 
<ol><li>为什么Python会提出这么多种的数据类型?</li></ol> 
<blockquote> 
 <p>有限的内存, 无限的变量, 合理的使用内存</p> 
</blockquote> 
<ol start="2"><li>Python中&#xff0c;程序员定义变量需要关心变量的类型吗?</li></ol> 
<blockquote> 
 <ul><li>Python弱类型语言</li><li>程序员不需要关心变量的类型, 只需要把数据书写正确即可&#xff0c;python会通过自动推到出您变量的类型。</li></ul> 
</blockquote> 
<h2><a id="_210"></a>七、输出</h2> 
<p><strong>作用&#xff1a;程序输出内容给用户。</strong></p> 
<pre><code class="prism language-python"><span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;hello Python&#39;</span><span class="token punctuation">)</span>

age <span class="token operator">&#61;</span> <span class="token number">18</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>age<span class="token punctuation">)</span>

<span class="token comment"># 需求&#xff1a;输出“今年我的年龄是18岁”</span>
</code></pre> 
<h3><a id="1__221"></a>1. 格式化输出</h3> 
<table><thead><tr><th align="center">格式符号</th><th align="center">转换</th></tr></thead><tbody><tr><td align="center"><mark>%s</mark></td><td align="center">字符串</td></tr><tr><td align="center"><mark>%d</mark></td><td align="center">有符号的十进制整数</td></tr><tr><td align="center"><mark>%f</mark></td><td align="center">浮点数</td></tr><tr><td align="center">%c</td><td align="center">字符</td></tr><tr><td align="center">%u</td><td align="center">无符号十进制整数</td></tr><tr><td align="center">%o</td><td align="center">八进制整数</td></tr><tr><td align="center">%x</td><td align="center">十六进制整数&#xff08;小写ox&#xff09;</td></tr><tr><td align="center">%X</td><td align="center">十六进制整数&#xff08;大写OX&#xff09;</td></tr><tr><td align="center">%e</td><td align="center">科学计数法&#xff08;小写’e’&#xff09;</td></tr><tr><td align="center">%E</td><td align="center">科学计数法&#xff08;大写’E’&#xff09;</td></tr><tr><td align="center">%g</td><td align="center">%f和%e的简写</td></tr><tr><td align="center">%G</td><td align="center">%f和%E的简写</td></tr></tbody></table>
<blockquote> 
 <ul><li>%06d&#xff0c;表示输出的整数显示位数&#xff0c;不足以0补全&#xff0c;超出当前位数则原样输出。</li><li>%.2f&#xff0c;表示小数点后显示的小数位数。</li></ul> 
</blockquote> 
<h3><a id="2_format_240"></a>2. 内置函数format</h3> 
<p>format()用于字符串格式化&#xff0c;功能非常强大&#xff0c;格式是str.format()&#xff0c;format函数可以接受不限个参数&#xff0c;位置可以不按顺序。</p> 
<h3><a id="3_f_242"></a>3. f-格式化字符串</h3> 
<p>f-string是格式化字符串的一种很好的新方法。与其他格式化方式相比&#xff0c;它不仅更易读&#xff0c;更简洁&#xff0c;不易出错&#xff0c;而且速度更快&#xff01;格式为&#xff1a;<code>f&#39;{表达式}&#39;</code>。</p> 
<h3><a id="4__245"></a>4. 体验格式化字符串</h3> 
<pre><code class="prism language-python">name <span class="token operator">&#61;</span> <span class="token string">&#34;张三&#34;</span>
age <span class="token operator">&#61;</span> <span class="token number">23</span>
weight <span class="token operator">&#61;</span> <span class="token number">75.5</span>
student_id <span class="token operator">&#61;</span> <span class="token number">1</span>

<span class="token comment"># 我的名字是张三</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的名字是%s&#39;</span> <span class="token operator">%</span> name<span class="token punctuation">)</span>

<span class="token comment"># 我的学号是0001</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的学号是%04d&#39;</span> <span class="token operator">%</span> student_id<span class="token punctuation">)</span>

<span class="token comment"># 我的体重是75.50公斤</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的体重是%.2f公斤&#39;</span> <span class="token operator">%</span> weight<span class="token punctuation">)</span>

<span class="token comment"># 我的名字是张三&#xff0c;今年23岁了</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的名字是%s&#xff0c;今年%d岁了&#39;</span> <span class="token operator">%</span> <span class="token punctuation">(</span>name<span class="token punctuation">,</span> age<span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 我的名字是张三&#xff0c;明年24岁了</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的名字是%s&#xff0c;明年%d岁了&#39;</span> <span class="token operator">%</span> <span class="token punctuation">(</span>name<span class="token punctuation">,</span> age <span class="token operator">&#43;</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 我的名字是张三&#xff0c;明年24岁了</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的名字是{0}, 明年{1}岁了&#39;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>name<span class="token punctuation">,</span> age<span class="token operator">&#43;</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 我的名字是李思&#xff0c;今年18岁了</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的名字是{0}, 今年{1}岁了&#39;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span><span class="token string">&#34;李思&#34;</span><span class="token punctuation">,</span> <span class="token number">18</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 我的名字是张三&#xff0c;明年24岁了</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;我的名字是{name}, 明年{age &#43; 1}岁了&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/2020063017412140.png" alt="在这里插入图片描述" /></p> 
<h3><a id="5__278"></a>5. 补充知识</h3> 
<p>字符串输出的本质其实就是拼接字符串&#xff0c;那么我们都用<code>%s</code>完全也是可以的。很多时候&#xff0c;我们不用区分整型、浮点型等&#xff0c;直接用<code>%s</code>输出就可以了。</p> 
<pre><code class="prism language-python"><span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的名字是%s&#xff0c;今年%s岁了&#xff0c;我的体重是%s公斤&#39;</span> <span class="token operator">%</span> <span class="token punctuation">(</span>name<span class="token punctuation">,</span> age <span class="token punctuation">,</span>weight<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200630174532554.png" alt="在这里插入图片描述" /></p> 
<h3><a id="6__285"></a>6. 转义字符</h3> 
<ul><li><code>\n</code>&#xff1a;换行。</li><li><code>\t</code>&#xff1a;制表符&#xff0c;一个tab键&#xff08;4个空格&#xff09;的距离。</li></ul> 
<h3><a id="7__289"></a>7. 结束符</h3> 
<pre><code class="prism language-python"><span class="token comment"># print会默认换行输出</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;输出的内容&#39;</span><span class="token punctuation">,</span> end<span class="token operator">&#61;</span><span class="token string">&#34;\n&#34;</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>在Python中&#xff0c;print()&#xff0c; 默认自带<code>end&#61;&#34;\n&#34;</code>这个换行结束符&#xff0c;所以导致每两个<code>print</code>直接会换行展示&#xff0c;用户可以按需求更改结束符。</p> 
</blockquote> 
<pre><code class="prism language-python"><span class="token comment"># 改变Python换行输出</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;内容&#39;</span><span class="token punctuation">,</span> end<span class="token operator">&#61;</span><span class="token string">&#34; &#34;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;内容&#39;</span><span class="token punctuation">,</span> end<span class="token operator">&#61;</span><span class="token string">&#34;···&#34;</span><span class="token punctuation">)</span>
</code></pre> 
<h2><a id="_302"></a>八、输入</h2> 
<p><strong>在Python中&#xff0c;程序接收用户输入的数据的功能即是输入。</strong><br /> <img src="https://img-blog.csdnimg.cn/2020063018072652.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h3><a id="1__305"></a>1. 输入的语法</h3> 
<pre><code class="prism language-python"><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#34;提示信息&#34;</span><span class="token punctuation">)</span>
</code></pre> 
<h3><a id="2__310"></a>2. 输入的特点</h3> 
<ul><li>当程序执行到<code>input</code>&#xff0c;等待用户输入&#xff0c;输入完成之后才继续向下执行。</li><li>在Python中&#xff0c;<code>input</code>接收用户输入后&#xff0c;一般存储到变量&#xff0c;方便使用。</li><li>在Python中&#xff0c;<code>input</code>会把接收到的任意用户输入的数据都当做字符串处理。</li></ul> 
<pre><code class="prism language-python">password <span class="token operator">&#61;</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请输入您的密码&#xff1a;&#39;</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您输入的密码是{password}&#39;</span><span class="token punctuation">)</span>
<span class="token comment"># &lt;class &#39;str&#39;&gt;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>password<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200630175345998.png" alt="在这里插入图片描述" /></p> 
<h2><a id="_323"></a>九、转换数据类型</h2> 
<h3><a id="1__324"></a>1. 转换数据类型的作用</h3> 
<p>问&#xff1a;input()接收用户输入的数据都是字符串类型&#xff0c;如果用户输入1&#xff0c;想得到整型该如何操作&#xff1f;</p> 
<p>答&#xff1a;转换数据类型即可&#xff0c;即将字符串类型转换成整型。</p> 
<h3><a id="2__328"></a>2. 转换数据类型的函数</h3> 
<table><thead><tr><th align="center">函数</th><th align="center">说明</th></tr></thead><tbody><tr><td align="center"><mark>int(x [,base ])</mark></td><td align="center">将x转换为一个整数</td></tr><tr><td align="center"><mark>float(x )</mark></td><td align="center">将x转换为一个浮点数</td></tr><tr><td align="center">complex(real [,imag ])</td><td align="center">创建一个复数&#xff0c;real为实部&#xff0c;imag为虚部</td></tr><tr><td align="center"><mark>str(x )</mark></td><td align="center">将对象 x 转换为字符串</td></tr><tr><td align="center">repr(x )</td><td align="center">将对象 x 转换为表达式字符串</td></tr><tr><td align="center"><mark>eval(str )</mark></td><td align="center">用来计算在字符串中的有效Python表达式,并返回一个对象</td></tr><tr><td align="center"><mark>tuple(s )</mark></td><td align="center">将序列 s 转换为一个元组</td></tr><tr><td align="center"><mark>list(s )</mark></td><td align="center">将序列 s 转换为一个列表</td></tr><tr><td align="center">chr(x )</td><td align="center">将一个整数转换为一个Unicode字符</td></tr><tr><td align="center">ord(x )</td><td align="center">将一个字符转换为它的ASCII整数值</td></tr><tr><td align="center">hex(x )</td><td align="center">将一个整数转换为一个十六进制字符串</td></tr><tr><td align="center">oct(x )</td><td align="center">将一个整数转换为一个八进制字符串</td></tr><tr><td align="center">bin(x )</td><td align="center">将一个整数转换为一个二进制字符串</td></tr></tbody></table>
<h3><a id="3__345"></a>3. 体验转换数据类型</h3> 
<p>需求&#xff1a;input接收用户输入&#xff0c;用户输入“1”&#xff0c;将这个数据1转换成整型。</p> 
<pre><code class="prism language-python"><span class="token comment"># 1. 接收用户输入</span>
num <span class="token operator">&#61;</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请输入您的幸运数字&#xff1a;&#39;</span><span class="token punctuation">)</span>

<span class="token comment"># 2. 打印结果</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#34;您的幸运数字是{num}&#34;</span><span class="token punctuation">)</span>


<span class="token comment"># 3. 检测接收到的用户输入的数据类型 -- str类型</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 4. 转换数据类型为整型 -- int类型</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<pre><code class="prism language-python"><span class="token comment"># 1. float() -- 转换成浮点型</span>
num1 <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">float</span><span class="token punctuation">(</span>num1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">float</span><span class="token punctuation">(</span>num1<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 2. str() -- 转换成字符串类型</span>
num2 <span class="token operator">&#61;</span> <span class="token number">10</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">str</span><span class="token punctuation">(</span>num2<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 3. tuple() -- 将一个序列转换成元组</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">tuple</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">tuple</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>


<span class="token comment"># 4. list() -- 将一个序列转换成列表</span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>t1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>t1<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 5. eval() -- 将字符串中的数据转换成Python表达式原本类型</span>
str1 <span class="token operator">&#61;</span> <span class="token string">&#39;10&#39;</span>
str2 <span class="token operator">&#61;</span> <span class="token string">&#39;[1, 2, 3]&#39;</span>
str3 <span class="token operator">&#61;</span> <span class="token string">&#39;(1000, 2000, 3000)&#39;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">eval</span><span class="token punctuation">(</span>str1<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">eval</span><span class="token punctuation">(</span>str2<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span><span class="token builtin">eval</span><span class="token punctuation">(</span>str3<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<h2><a id="_392"></a>十、运算符</h2> 
<h3><a id="1__393"></a>1. 运算符的分类</h3> 
<ul><li>算数运算符</li><li>赋值运算符</li><li>复合赋值运算符</li><li>比较运算符</li><li>逻辑运算符</li></ul> 
<h3><a id="2__399"></a>2. 算数运算符</h3> 
<table><thead><tr><th align="center">运算符</th><th align="center">描述</th><th>实例</th></tr></thead><tbody><tr><td align="center">&#43;</td><td align="center">加</td><td>1 &#43; 1 输出结果为 2</td></tr><tr><td align="center">-</td><td align="center">减</td><td>1-1 输出结果为 0</td></tr><tr><td align="center">*</td><td align="center">乘</td><td>2 * 2 输出结果为 4</td></tr><tr><td align="center">/</td><td align="center">除</td><td>10 / 2 输出结果为 5</td></tr><tr><td align="center">//</td><td align="center">整除</td><td>9 // 4 输出结果为2</td></tr><tr><td align="center">%</td><td align="center">取余</td><td>9 % 4 输出结果为 1</td></tr><tr><td align="center">**</td><td align="center">指数</td><td>2 ** 4 输出结果为 16&#xff0c;即 2 * 2 * 2 * 2</td></tr><tr><td align="center">()</td><td align="center">小括号</td><td>小括号用来提高运算优先级&#xff0c;即 (1 &#43; 2) * 3 输出结果为 9</td></tr></tbody></table>
<blockquote> 
 <p>混合运算优先级顺序&#xff1a;<code>()</code>高于 <code>**</code> 高于 <code>*</code> <code>/</code> <code>//</code> <code>%</code> 高于 <code>&#43;</code> <code>-</code></p> 
</blockquote> 
<h3><a id="3__413"></a>3. 赋值运算符</h3> 
<table><thead><tr><th>运算符</th><th>描述</th><th>实例</th></tr></thead><tbody><tr><td>&#61;</td><td>赋值</td><td>将<code>&#61;</code>右侧的结果赋值给等号左侧的变量</td></tr></tbody></table>
<ol><li>单个变量赋值</li></ol> 
<pre><code class="prism language-python">num <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span>
</code></pre> 
<ol start="2"><li>多个变量赋值</li></ol> 
<pre><code class="prism language-python">num1<span class="token punctuation">,</span> float1<span class="token punctuation">,</span> str1 <span class="token operator">&#61;</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">0.5</span><span class="token punctuation">,</span> <span class="token string">&#39;hello world&#39;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>num1<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>float1<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>str1<span class="token punctuation">)</span>
</code></pre> 
<ol start="3"><li>多变量赋相同值</li></ol> 
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> b <span class="token operator">&#61;</span> <span class="token number">10</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span>
</code></pre> 
<h3><a id="4__439"></a>4. 复合赋值运算符</h3> 
<table><thead><tr><th>运算符</th><th>描述</th><th>实例</th></tr></thead><tbody><tr><td>&#43;&#61;</td><td>加法赋值运算符</td><td>c &#43;&#61; a 等价于 c &#61; c &#43; a</td></tr><tr><td>-&#61;</td><td>减法赋值运算符</td><td>c -&#61; a 等价于 c &#61; c- a</td></tr><tr><td>*&#61;</td><td>乘法赋值运算符</td><td>c *&#61; a 等价于 c &#61; c * a</td></tr><tr><td>/&#61;</td><td>除法赋值运算符</td><td>c /&#61; a 等价于 c &#61; c / a</td></tr><tr><td>//&#61;</td><td>整除赋值运算符</td><td>c //&#61; a 等价于 c &#61; c // a</td></tr><tr><td>%&#61;</td><td>取余赋值运算符</td><td>c %&#61; a 等价于 c &#61; c % a</td></tr><tr><td>**&#61;</td><td>幂赋值运算符</td><td>c ** &#61; a 等价于 c &#61; c ** a</td></tr></tbody></table>
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> <span class="token number">100</span>
a <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
<span class="token comment"># 输出101  a &#61; a &#43; 1,最终a &#61; 100 &#43; 1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>

b <span class="token operator">&#61;</span> <span class="token number">2</span>
b <span class="token operator">*&#61;</span> <span class="token number">3</span>
<span class="token comment"># 输出6  b &#61; b * 3,最终b &#61; 2 * 3</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span>

c <span class="token operator">&#61;</span> <span class="token number">10</span>
c <span class="token operator">&#43;&#61;</span> <span class="token number">1</span> <span class="token operator">&#43;</span> <span class="token number">2</span>
<span class="token comment"># 输出13, 先算运算符右侧1 &#43; 2 &#61; 3&#xff0c; c &#43;&#61; 3 , 推导出c &#61; 10 &#43; 3</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span>
</code></pre> 
<h3><a id="5__466"></a>5. 比较运算符</h3> 
<p><strong>比较运算符也叫关系运算符&#xff0c; 通常用来判断。</strong></p> 
<table><thead><tr><th>运算符</th><th>描述</th><th>实例</th></tr></thead><tbody><tr><td>&#61;&#61;</td><td>判断相等。如果两个操作数的结果相等&#xff0c;则条件结果为真(True)&#xff0c;否则条件结果为假(False)</td><td>如a&#61;3,b&#61;3&#xff0c;则&#xff08;a &#61;&#61; b) 为 True</td></tr><tr><td>!&#61;</td><td>不等于 。如果两个操作数的结果不相等&#xff0c;则条件为真(True)&#xff0c;否则条件结果为假(False)</td><td>如a&#61;3,b&#61;3&#xff0c;则&#xff08;a &#61;&#61; b) 为 True如a&#61;1,b&#61;3&#xff0c;则(a !&#61; b) 为 True</td></tr><tr><td>&gt;</td><td>运算符左侧操作数结果是否大于右侧操作数结果&#xff0c;如果大于&#xff0c;则条件为真&#xff0c;否则为假</td><td>如a&#61;7,b&#61;3&#xff0c;则(a &gt; b) 为 True</td></tr><tr><td>&lt;</td><td>运算符左侧操作数结果是否小于右侧操作数结果&#xff0c;如果小于&#xff0c;则条件为真&#xff0c;否则为假</td><td>如a&#61;7,b&#61;3&#xff0c;则(a &lt; b) 为 False</td></tr><tr><td>&gt;&#61;</td><td>运算符左侧操作数结果是否大于等于右侧操作数结果&#xff0c;如果大于&#xff0c;则条件为真&#xff0c;否则为假</td><td>如a&#61;7,b&#61;3&#xff0c;则(a &lt; b) 为 False如a&#61;3,b&#61;3&#xff0c;则(a &gt;&#61; b) 为 True</td></tr><tr><td>&lt;&#61;</td><td>运算符左侧操作数结果是否小于等于右侧操作数结果&#xff0c;如果小于&#xff0c;则条件为真&#xff0c;否则为假</td><td>如a&#61;3,b&#61;3&#xff0c;则(a &lt;&#61; b) 为 True</td></tr></tbody></table>
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> <span class="token number">7</span>
b <span class="token operator">&#61;</span> <span class="token number">5</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">&#61;&#61;</span> b<span class="token punctuation">)</span>  <span class="token comment"># False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">!&#61;</span> b<span class="token punctuation">)</span>  <span class="token comment"># True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">&lt;</span> b<span class="token punctuation">)</span>   <span class="token comment"># False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">&gt;</span> b<span class="token punctuation">)</span>   <span class="token comment"># True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">&lt;&#61;</span> b<span class="token punctuation">)</span>  <span class="token comment"># False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">&gt;&#61;</span> b<span class="token punctuation">)</span>  <span class="token comment"># True</span>
</code></pre> 
<h3><a id="6__487"></a>6. 逻辑运算符</h3> 
<table><thead><tr><th>运算符</th><th>逻辑表达式</th><th>描述</th><th>实例</th></tr></thead><tbody><tr><td>and</td><td>x and y</td><td>布尔&#34;与&#34;&#xff1a;如果 x 为 False&#xff0c;x and y 返回 False&#xff0c;否则它返回 y 的值。</td><td>True and False&#xff0c; 返回 False。</td></tr><tr><td>or</td><td>x or y</td><td>布尔&#34;或&#34;&#xff1a;如果 x 是 True&#xff0c;它返回 True&#xff0c;否则它返回 y 的值。</td><td>False or True&#xff0c; 返回 True。</td></tr><tr><td>not</td><td>not x</td><td>布尔&#34;非&#34;&#xff1a;如果 x 为 True&#xff0c;返回 False 。如果 x 为 False&#xff0c;它返回 True。</td><td>not True 返回 False, not False 返回 True</td></tr></tbody></table>
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> <span class="token number">1</span>
b <span class="token operator">&#61;</span> <span class="token number">2</span>
c <span class="token operator">&#61;</span> <span class="token number">3</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">(</span>a <span class="token operator">&lt;</span> b<span class="token punctuation">)</span> <span class="token operator">and</span> <span class="token punctuation">(</span>b <span class="token operator">&lt;</span> c<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">(</span>a <span class="token operator">&gt;</span> b<span class="token punctuation">)</span> <span class="token operator">and</span> <span class="token punctuation">(</span>b <span class="token operator">&lt;</span> c<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">(</span>a <span class="token operator">&gt;</span> b<span class="token punctuation">)</span> <span class="token operator">or</span> <span class="token punctuation">(</span>b <span class="token operator">&lt;</span> c<span class="token punctuation">)</span><span class="token punctuation">)</span>   <span class="token comment"># True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token operator">not</span> <span class="token punctuation">(</span>a <span class="token operator">&gt;</span> b<span class="token punctuation">)</span><span class="token punctuation">)</span>          <span class="token comment"># True</span>
</code></pre> 
<h3><a id="7__503"></a>7. 补充知识</h3> 
<p>数字之间的逻辑运算</p> 
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> <span class="token number">0</span>
b <span class="token operator">&#61;</span> <span class="token number">1</span>
c <span class="token operator">&#61;</span> <span class="token number">2</span>

<span class="token comment"># and运算符&#xff0c;只要有一个值为0&#xff0c;则结果为0&#xff0c;否则结果为最后一个非0数字</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">and</span> b<span class="token punctuation">)</span>  <span class="token comment"># 0</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b <span class="token operator">and</span> a<span class="token punctuation">)</span>  <span class="token comment"># 0</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">and</span> c<span class="token punctuation">)</span>  <span class="token comment"># 0</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>c <span class="token operator">and</span> a<span class="token punctuation">)</span>  <span class="token comment"># 0</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b <span class="token operator">and</span> c<span class="token punctuation">)</span>  <span class="token comment"># 2</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>c <span class="token operator">and</span> b<span class="token punctuation">)</span>  <span class="token comment"># 1</span>

<span class="token comment"># or运算符&#xff0c;只有所有值为0结果才为0&#xff0c;否则结果为第一个非0数字</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">or</span> b<span class="token punctuation">)</span>  <span class="token comment"># 1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a <span class="token operator">or</span> c<span class="token punctuation">)</span>  <span class="token comment"># 2</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b <span class="token operator">or</span> c<span class="token punctuation">)</span>  <span class="token comment"># 1</span>
</code></pre> 
<h2><a id="_524"></a>十一、条件语句</h2> 
<h3><a id="1__525"></a>1. 了解条件语句</h3> 
<p>Python条件语句是通过一条或多条语句的执行结果&#xff08;True或者False&#xff09;来决定执行的代码块。</p> 
<h3><a id="2_if_528"></a>2. if语法</h3> 
<pre><code class="prism language-python"><span class="token keyword">if</span> 条件<span class="token punctuation">:</span>
    条件成立执行的代码<span class="token number">1</span>
    条件成立执行的代码<span class="token number">2</span>
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
</code></pre> 
<h4><a id="21_if_535"></a>2.1 体验if语句</h4> 
<pre><code class="prism language-python"><span class="token keyword">if</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;条件成立执行的代码1&#39;</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;条件成立执行的代码2&#39;</span><span class="token punctuation">)</span>

<span class="token comment"># 下方的代码没有缩进到if语句块&#xff0c;所以和if条件无关</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我是无论条件是否成立都要执行的代码&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200630183252892.png" alt="在这里插入图片描述" /></p> 
<h4><a id="22__546"></a>2.2 简单版&#xff1a;网吧上网</h4> 
<p>需求分析&#xff1a;如果用户年龄大于等于18岁&#xff0c;即成年&#xff0c;输出&#34;已经成年&#xff0c;可以上网&#34;。</p> 
<pre><code class="prism language-python">age <span class="token operator">&#61;</span> <span class="token number">20</span>
<span class="token keyword">if</span> age <span class="token operator">&gt;&#61;</span> <span class="token number">18</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;已经成年&#xff0c;可以上网&#39;</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;系统关闭&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<h4><a id="23__556"></a>2.3 进阶版&#xff1a;网吧上网</h4> 
<p>新增需求&#xff1a;用户可以输出自己的年龄&#xff0c;然后系统进行判断是否成年&#xff0c;成年则输出&#34;您的年龄是’用户输入的年龄’&#xff0c;已经成年&#xff0c;可以上网&#34;。</p> 
<pre><code class="prism language-python"><span class="token comment"># input接受用户输入的数据是字符串类型&#xff0c;条件是age和整型18做判断&#xff0c;所以这里要int转换数据类型</span>
age <span class="token operator">&#61;</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请输入您的年龄&#xff1a;&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token keyword">if</span> age <span class="token operator">&gt;&#61;</span> <span class="token number">18</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您的年龄是{age},已经成年&#xff0c;可以上网&#39;</span><span class="token punctuation">)</span>


<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;系统关闭&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<h3><a id="3_ifelse_569"></a>3. if…else…</h3> 
<p>作用&#xff1a;条件成立执行if下方的代码; 条件不成立执行else下方的代码。</p> 
<pre><code class="prism language-python"><span class="token keyword">if</span> 条件<span class="token punctuation">:</span>
    条件成立执行的代码<span class="token number">1</span>
    条件成立执行的代码<span class="token number">2</span>
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    条件不成立执行的代码<span class="token number">1</span>
    条件不成立执行的代码<span class="token number">2</span>
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
</code></pre> 
<blockquote> 
 <p>思考&#xff1a;网吧上网的实例&#xff0c;如果成年&#xff0c;允许上网&#xff0c;如果不成年呢&#xff1f;是不是应该回复用户不能上网&#xff1f;</p> 
</blockquote> 
<h4><a id="31__584"></a>3.1 实用版&#xff1a;网吧上网</h4> 
<pre><code class="prism language-python">age <span class="token operator">&#61;</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请输入您的年龄&#xff1a;&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token keyword">if</span> age <span class="token operator">&gt;&#61;</span> <span class="token number">18</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您的年龄是{age},已经成年&#xff0c;可以上网&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您的年龄是{age},未成年&#xff0c;请自行回家写作业&#39;</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;系统关闭&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;如果条件成立执行了某些代码&#xff0c;那么其他的情况的代码将不会执行。</p> 
</blockquote> 
<h3><a id="4__598"></a>4. 多重判断</h3> 
<pre><code class="prism language-python"><span class="token keyword">if</span> 条件<span class="token number">1</span><span class="token punctuation">:</span>
    条件<span class="token number">1</span>成立执行的代码<span class="token number">1</span>
    条件<span class="token number">1</span>成立执行的代码<span class="token number">2</span>
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token keyword">elif</span> 条件<span class="token number">2</span>&#xff1a;
	条件<span class="token number">2</span>成立执行的代码<span class="token number">1</span>
    条件<span class="token number">2</span>成立执行的代码<span class="token number">2</span>
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    以上条件都不成立执行执行的代码
</code></pre> 
<p>多重判断也可以和else配合使用。一般else放在整个if语句的最后&#xff0c;表示以上条件都不成立的时候执行的代码。</p> 
<blockquote> 
 <p>思考&#xff1a;中国合法工作年龄为18-60岁&#xff0c;即如果年龄小于18的情况为童工&#xff0c;不合法&#xff1b;如果年龄在18-60岁之间为合法工龄&#xff1b;大于60岁为法定退休年龄。</p> 
</blockquote> 
<h4><a id="41__617"></a>4.1 实例&#xff1a;工龄判断</h4> 
<pre><code class="prism language-python">age <span class="token operator">&#61;</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请输入您的年龄&#xff1a;&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> age <span class="token operator">&lt;</span> <span class="token number">18</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您的年龄是{age},童工一枚&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> <span class="token punctuation">(</span>age <span class="token operator">&gt;&#61;</span> <span class="token number">18</span><span class="token punctuation">)</span> <span class="token operator">and</span> <span class="token punctuation">(</span>age <span class="token operator">&lt;&#61;</span> <span class="token number">60</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您的年龄是{age},合法工龄&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> age <span class="token operator">&gt;</span> <span class="token number">60</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您的年龄是{age},可以退休&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>拓展&#xff1a;<code>age &gt;&#61; 18 and age &lt;&#61; 60</code>可以化简为<code>18 &lt;&#61; age &lt;&#61; 60</code>。</p> 
</blockquote> 
<h3><a id="5_if_630"></a>5. if嵌套</h3> 
<pre><code class="prism language-python"><span class="token keyword">if</span> 条件<span class="token number">1</span>&#xff1a;
	条件<span class="token number">1</span>成立执行的代码
    条件<span class="token number">1</span>成立执行的代码
    
    <span class="token keyword">if</span> 条件<span class="token number">2</span>&#xff1a;
    	条件<span class="token number">2</span>成立执行的代码
        条件<span class="token number">2</span>成立执行的代码
</code></pre> 
<p>注意&#xff1a;条件2的if也是出于条件1的缩进关系内部。</p> 
<blockquote> 
 <p>思考&#xff1a;坐公交&#xff1a;如果有钱可以上车&#xff0c;没钱不能上车&#xff1b;上车后如果有空座&#xff0c;则可以坐下&#xff1b;如果没空座&#xff0c;就要站着。怎么书写程序&#xff1f;</p> 
</blockquote> 
<h4><a id="51__645"></a>5.1 实例&#xff1a;坐公交</h4> 
<ol><li>判断是否能上车</li></ol> 
<pre><code class="prism language-python"><span class="token triple-quoted-string string">&#34;&#34;&#34;
	1. 如果有钱&#xff0c;则可以上车
    2. 上车后&#xff0c;如果有空座&#xff0c;可以坐下
    上车后&#xff0c;如果没有空座&#xff0c;则站着等空座位
	如果没钱&#xff0c;不能上车
&#34;&#34;&#34;</span>
<span class="token comment"># 假设用 money &#61; 1 表示有钱, money &#61; 0表示没有钱</span>
money <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">if</span> money <span class="token operator">&#61;&#61;</span> <span class="token number">1</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;土豪&#xff0c;不差钱&#xff0c;顺利上车&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;没钱&#xff0c;不能上车&#xff0c;追着公交车跑&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<ol start="2"><li>判断是否能坐下</li></ol> 
<pre><code class="prism language-python"><span class="token triple-quoted-string string">&#34;&#34;&#34;
	1. 如果有钱&#xff0c;则可以上车
    2. 上车后&#xff0c;如果有空座&#xff0c;可以坐下
    上车后&#xff0c;如果没有空座&#xff0c;则站着等空座位
	如果没钱&#xff0c;不能上车
&#34;&#34;&#34;</span>
<span class="token comment"># 假设用 money &#61; 1 表示有钱, money &#61; 0表示没有钱; seat &#61; 1 表示有空座&#xff0c;seat &#61; 0 表示没有空座</span>
money <span class="token operator">&#61;</span> <span class="token number">1</span>
seat <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">if</span> money <span class="token operator">&#61;&#61;</span> <span class="token number">1</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;土豪&#xff0c;不差钱&#xff0c;顺利上车&#39;</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> seat <span class="token operator">&#61;&#61;</span> <span class="token number">1</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;有空座&#xff0c;可以坐下&#39;</span><span class="token punctuation">)</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;没有空座&#xff0c;站等&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;没钱&#xff0c;不能上车&#xff0c;追着公交车跑&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<h4><a id="52_if_683"></a>5.2 if嵌套执行流程</h4> 
<p><img src="https://img-blog.csdnimg.cn/20200701094142253.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h3><a id="6__685"></a>6. 应用&#xff1a;猜拳游戏</h3> 
<p>需求分析&#xff1a;</p> 
<ul><li> <p>参与游戏的角色</p> 
  <ul><li>玩家 
    <ul><li>手动出拳</li></ul> </li><li>电脑 
    <ul><li>随机出拳</li></ul> </li></ul> </li><li> <p>判断输赢</p> 
  <ul><li>玩家获胜</li></ul> 
  <table><thead><tr><th>玩家</th><th>电脑</th></tr></thead><tbody><tr><td>石头</td><td>剪刀</td></tr><tr><td>剪刀</td><td>布</td></tr><tr><td>布</td><td>石头</td></tr></tbody></table>
  <ul><li>平局 
    <ul><li>玩家出拳 和 电脑出拳相同</li></ul> </li><li>电脑获胜</li></ul> </li></ul> 
<p>随机做法&#xff1a;</p> 
<ol><li>导出random模块</li></ol> 
<pre><code class="prism language-python"><span class="token keyword">import</span> 模块名
</code></pre> 
<ol start="2"><li>使用random模块中的随机整数功能</li></ol> 
<pre><code class="prism language-python">random<span class="token punctuation">.</span>randint<span class="token punctuation">(</span>开始<span class="token punctuation">,</span>结束<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="61__722"></a>6.1 初始版&#xff1a;猜拳游戏</h4> 
<pre><code class="prism language-python"><span class="token triple-quoted-string string">&#34;&#34;&#34;
提示&#xff1a;0-石头&#xff0c;1-剪刀&#xff0c;2-布
3. 出拳
玩家输入出拳
电脑随机出拳

4. 判断输赢
玩家获胜
平局
电脑获胜
&#34;&#34;&#34;</span>

<span class="token comment"># 导入random模块</span>
<span class="token keyword">import</span> random

<span class="token comment"># 计算电脑出拳的随机数字</span>
computer <span class="token operator">&#61;</span> random<span class="token punctuation">.</span>randint<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>computer<span class="token punctuation">)</span>

player <span class="token operator">&#61;</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请出拳&#xff1a;0-石头&#xff0c;1-剪刀&#xff0c;2-布&#xff1a;&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># 玩家胜利 p0:c1 或 p1:c2 或 p2:c0</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span>player <span class="token operator">&#61;&#61;</span> <span class="token number">0</span> <span class="token operator">and</span> computer <span class="token operator">&#61;&#61;</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">or</span> <span class="token punctuation">(</span>player <span class="token operator">&#61;&#61;</span> <span class="token number">1</span> <span class="token operator">and</span> computer <span class="token operator">&#61;&#61;</span> <span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">or</span> <span class="token punctuation">(</span>player <span class="token operator">&#61;&#61;</span> <span class="token number">2</span> <span class="token operator">and</span> computer <span class="token operator">&#61;&#61;</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;玩家获胜&#39;</span><span class="token punctuation">)</span>

<span class="token comment"># 平局&#xff1a;玩家 &#61;&#61; 电脑</span>
<span class="token keyword">elif</span> player <span class="token operator">&#61;&#61;</span> computer<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;平局&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;电脑获胜&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<h4><a id="62__755"></a>6.2 进阶版&#xff1a;猜拳游戏</h4> 
<pre><code class="prism language-python"><span class="token triple-quoted-string string">&#34;&#34;&#34;
石头剪刀布游戏
玩家VS电脑
站在玩家的角度&#xff0c;分析胜利、失败、平局
0-石头&#xff0c;1-剪刀&#xff0c;2-布
&#34;&#34;&#34;</span>
<span class="token comment"># 导入随机数模块</span>
<span class="token keyword">import</span> random

<span class="token keyword">import</span> sys

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;-----欢迎来到人机对战小游戏-----&#34;</span><span class="token punctuation">)</span>
name <span class="token operator">&#61;</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#34;请输入您的游戏名&#xff1a;&#34;</span><span class="token punctuation">)</span>
<span class="token keyword">while</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
    stats <span class="token operator">&#61;</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#34;欢迎“%s”来到本游戏&#xff0c;开始游戏输入Y&#xff0c;退出游戏输入N&#xff0c;请您输入&#xff1a;&#34;</span> <span class="token operator">%</span> name<span class="token punctuation">)</span>
    <span class="token keyword">if</span> stats <span class="token operator">&#61;&#61;</span> <span class="token string">&#34;Y&#34;</span> <span class="token operator">or</span> stats <span class="token operator">&#61;&#61;</span> <span class="token string">&#34;y&#34;</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;游戏开始……&#34;</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;石头输入0、剪刀输入1、布输入2&#34;</span><span class="token punctuation">)</span>
        <span class="token keyword">break</span>
    <span class="token keyword">elif</span> stats <span class="token operator">&#61;&#61;</span> <span class="token string">&#34;N&#34;</span> <span class="token operator">or</span> stats <span class="token operator">&#61;&#61;</span> <span class="token string">&#34;n&#34;</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;游戏结束……&#34;</span><span class="token punctuation">)</span>
        sys<span class="token punctuation">.</span>exit<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;请按照要求重新输入&#xff01;&#34;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;-------------加载中-------------&#34;</span><span class="token punctuation">)</span>


<span class="token keyword">def</span> <span class="token function">Game</span><span class="token punctuation">(</span>user<span class="token punctuation">,</span> comp<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>user<span class="token operator">&#61;&#61;</span> <span class="token number">0</span> <span class="token operator">and</span> comp<span class="token operator">&#61;&#61;</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">or</span> <span class="token punctuation">(</span>user<span class="token operator">&#61;&#61;</span> <span class="token number">1</span> <span class="token operator">and</span> comp<span class="token operator">&#61;&#61;</span> <span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">or</span> <span class="token punctuation">(</span>user<span class="token operator">&#61;&#61;</span> <span class="token number">2</span> <span class="token operator">and</span> comp<span class="token operator">&#61;&#61;</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;机器输入%d&#xff0c;您赢了&#xff01;&#34;</span> <span class="token operator">%</span> comp<span class="token punctuation">)</span>
    <span class="token keyword">elif</span> user <span class="token operator">&#61;&#61;</span> comp<span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;机器输入%d&#xff0c;平局了&#xff01;&#34;</span> <span class="token operator">%</span> comp<span class="token punctuation">)</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;机器输入%d&#xff0c;您输了&#xff01;&#34;</span> <span class="token operator">%</span> comp<span class="token punctuation">)</span>
    res <span class="token operator">&#61;</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#34;重新游戏请输入X&#xff0c;退出游戏按任意键&#34;</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> res <span class="token operator">&#61;&#61;</span> <span class="token string">&#34;X&#34;</span> <span class="token operator">or</span> res <span class="token operator">&#61;&#61;</span> <span class="token string">&#34;x&#34;</span><span class="token punctuation">:</span>
        <span class="token keyword">return</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        sys<span class="token punctuation">.</span>exit<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span>


<span class="token keyword">while</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
    user <span class="token operator">&#61;</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#34;请您出拳&#xff0c;输入相应数字&#xff01;&#34;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> user <span class="token operator">&#61;&#61;</span> <span class="token number">0</span> <span class="token operator">or</span> user <span class="token operator">&#61;&#61;</span> <span class="token number">1</span> <span class="token operator">or</span> user <span class="token operator">&#61;&#61;</span> <span class="token number">2</span><span class="token punctuation">:</span>
        comp <span class="token operator">&#61;</span> random<span class="token punctuation">.</span>randint<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span>
        Game<span class="token punctuation">(</span>user<span class="token punctuation">,</span> comp<span class="token punctuation">)</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;输入数字有误&#xff0c;请确认后&#xff0c;重新输入&#xff01;&#34;</span><span class="token punctuation">)</span>

</code></pre> 
<h3><a id="7___809"></a>7. 三目运算符</h3> 
<p><strong>三目运算符也叫三元运算符。</strong></p> 
<p>语法如下&#xff1a;</p> 
<pre><code class="prism language-python">值<span class="token number">1</span> <span class="token keyword">if</span> 条件 <span class="token keyword">else</span> 值<span class="token number">2</span>
</code></pre> 
<p>快速体验&#xff1a;</p> 
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> <span class="token number">1</span>
b <span class="token operator">&#61;</span> <span class="token number">2</span>

c <span class="token operator">&#61;</span> a <span class="token keyword">if</span> a <span class="token operator">&gt;</span> b <span class="token keyword">else</span> b
<span class="token keyword">print</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span>
</code></pre> 
<h2><a id="_827"></a>十二、循环简介</h2> 
<h3><a id="1___828"></a>1. 循环的作用</h3> 
<p><strong>让代码更高效的重复执行。</strong></p> 
<h3><a id="2___831"></a>2. 循环的分类</h3> 
<p>在Python中&#xff0c;循环分为<code>while</code>和<code>for</code>两种&#xff0c;最终实现效果相同。</p> 
<h3><a id="3_while_834"></a>3. while的语法</h3> 
<pre><code class="prism language-python"><span class="token keyword">while</span> 条件<span class="token punctuation">:</span>
    条件成立重复执行的代码<span class="token number">1</span>
    条件成立重复执行的代码<span class="token number">2</span>
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
</code></pre> 
<h3><a id="4_while_842"></a>4. while循环快速体验</h3> 
<p>需求&#xff1a;复现重复执行10次<code>print(&#39;Hello World&#39;)</code>。</p> 
<p>分析&#xff1a;初始值是0次&#xff0c;终点是10次&#xff0c;重复做的事情输出“Hello World”。</p> 
<pre><code class="prism language-python"><span class="token comment"># 循环的计数器</span>
i <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;</span> <span class="token number">10</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Hello World&#39;</span><span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;任务结束&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<h3><a id="5_while_856"></a>5. while的应用</h3> 
<h4><a id="51_1100_857"></a>5.1 应用一&#xff1a;计算1-100累加和</h4> 
<p>分析&#xff1a;1-100的累加和&#xff0c;即1 &#43; 2 &#43; 3 &#43; 4 &#43;….&#xff0c;即前两个数字的相加结果 &#43; 下一个数字( 前一个数字 &#43; 1)。</p> 
<pre><code class="prism language-python">i <span class="token operator">&#61;</span> <span class="token number">1</span>
result <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">100</span><span class="token punctuation">:</span>
    result <span class="token operator">&#43;&#61;</span> i
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>

<span class="token comment"># 输出5050</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>result<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;为了验证程序的准确性&#xff0c;可以先改小数值&#xff0c;验证结果正确后&#xff0c;再改成1-100做累加。</p> 
</blockquote> 
<h4><a id="52_1100_872"></a>5.2 应用二&#xff1a;计算1-100偶数累加和</h4> 
<p>分析&#xff1a;1-100的偶数和&#xff0c;即 2 &#43; 4 &#43; 6 &#43; 8…&#xff0c;得到偶数的方法如下&#xff1a;</p> 
<ul><li>偶数即是和2取余结果为0的数字&#xff0c;可以加入条件语句判断是否为偶数&#xff0c;为偶数则累加</li><li>初始值为0 / 2 , 计数器每次累加2</li></ul> 
<p><strong>方法一&#xff1a;条件判断和2取余数则累加</strong></p> 
<pre><code class="prism language-python"><span class="token comment"># 方法一&#xff1a;条件判断和2取余数为0则累加计算</span>
i <span class="token operator">&#61;</span> <span class="token number">1</span>
result <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">100</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">%</span> <span class="token number">2</span> <span class="token operator">&#61;&#61;</span> <span class="token number">0</span><span class="token punctuation">:</span>
        result <span class="token operator">&#43;&#61;</span> i
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>

<span class="token comment"># 输出2550</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>result<span class="token punctuation">)</span>
</code></pre> 
<p><strong>方法二&#xff1a;计数器控制</strong></p> 
<pre><code class="prism language-python"><span class="token comment"># 方法二&#xff1a;计数器控制增量为2</span>
i <span class="token operator">&#61;</span> <span class="token number">0</span>
result <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">100</span><span class="token punctuation">:</span>
    result <span class="token operator">&#43;&#61;</span> i
    i <span class="token operator">&#43;&#61;</span> <span class="token number">2</span>

<span class="token comment"># 输出2550</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>result<span class="token punctuation">)</span>
</code></pre> 
<h3><a id="6_breakcontinue_905"></a>6. break和continue</h3> 
<p><strong>break和continue是循环中满足一定条件退出循环的两种不同方式。</strong></p> 
<h4><a id="61__908"></a>6.1 理解</h4> 
<p>举例&#xff1a;一共吃5个苹果&#xff0c;吃完第一个&#xff0c;吃第二个…&#xff0c;这里&#34;吃苹果&#34;的动作是不是重复执行&#xff1f;</p> 
<p>情况一&#xff1a;如果吃的过程中&#xff0c;吃完第三个吃饱了&#xff0c;则不需要再吃第4个和第五个苹果&#xff0c;即是吃苹果的动作停止&#xff0c;这里就是break控制循环流程&#xff0c;即<mark>终止此循环</mark>。</p> 
<p>情况二&#xff1a;如果吃的过程中&#xff0c;吃到第三个吃出一个大虫子…,是不是这个苹果就不吃了&#xff0c;开始吃第四个苹果&#xff0c;这里就是continue控制循环流程&#xff0c;即<mark>退出当前一次循环继而执行下一次循环代码</mark>。</p> 
<h4><a id="62_break_914"></a>6.2 break实例</h4> 
<pre><code class="prism language-python">i <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">5</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token number">4</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;吃饱了不吃了&#39;</span><span class="token punctuation">)</span>
        <span class="token keyword">break</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;吃了第{i}个苹果&#39;</span><span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/2020071818190989.png" alt="在这里插入图片描述" /></p> 
<h4><a id="63_continue_926"></a>6.3 continue实例</h4> 
<pre><code class="prism language-python">i <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">5</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token number">3</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;大虫子&#xff0c;第{i}个不吃了&#39;</span><span class="token punctuation">)</span>
        <span class="token comment"># 在continue之前一定要修改计数器&#xff0c;否则会陷入死循环</span>
        i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;吃了第{i}个苹果&#39;</span><span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718184445477.png" alt="在这里插入图片描述" /></p> 
<h3><a id="7_while_940"></a>7. while循环嵌套</h3> 
<h4><a id="71__941"></a>7.1 语法</h4> 
<pre><code class="prism language-python"><span class="token keyword">while</span> 条件<span class="token number">1</span><span class="token punctuation">:</span>
    条件<span class="token number">1</span>成立执行的代码
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
    <span class="token keyword">while</span> 条件<span class="token number">2</span><span class="token punctuation">:</span>
        条件<span class="token number">2</span>成立执行的代码
        <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
</code></pre> 
<blockquote> 
 <p>总结&#xff1a;所谓while循环嵌套&#xff0c;就是一个while里面嵌套一个while的写法&#xff0c;每个while和之前的基础语法是相同的。</p> 
</blockquote> 
<h4><a id="72__953"></a>7.2 执行过程</h4> 
<p>当内部循环执行完成之后&#xff0c;再执行下一次外部循环的条件判断。<br /> <img src="https://img-blog.csdnimg.cn/20200718185621834.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h4><a id="73_while_956"></a>7.3 while循环嵌套应用</h4> 
<p><strong>应用一&#xff1a;打印星号&#xff08;正方形&#xff09;</strong></p> 
<pre><code class="prism language-python"><span class="token comment"># 重复打印5行星星</span>
j <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> j <span class="token operator">&lt;&#61;</span> <span class="token number">4</span><span class="token punctuation">:</span>
    <span class="token comment"># 一行星星的打印</span>
    i <span class="token operator">&#61;</span> <span class="token number">0</span>
    <span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">4</span><span class="token punctuation">:</span>
        <span class="token comment"># 一行内的星星不能换行&#xff0c;取消print默认结束符\n</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;*&#39;</span><span class="token punctuation">,</span> end<span class="token operator">&#61;</span><span class="token string">&#39;&#39;</span><span class="token punctuation">)</span>
        i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
    <span class="token comment"># 每行结束要换行&#xff0c;这里借助一个空的print&#xff0c;利用print默认结束符换行</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    j <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718185904513.png" alt="在这里插入图片描述" /><br /> <strong>应用二&#xff1a;打印星号&#xff08;三角形&#xff09;</strong></p> 
<pre><code class="prism language-python"><span class="token comment"># 重复打印5行星星</span>
<span class="token comment"># j表示行号</span>
j <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> j <span class="token operator">&lt;&#61;</span> <span class="token number">4</span><span class="token punctuation">:</span>
    <span class="token comment"># 一行星星的打印</span>
    i <span class="token operator">&#61;</span> <span class="token number">0</span>
    <span class="token comment"># i表示每行里面星星的个数&#xff0c;这个数字要和行号相等所以i要和j联动</span>
    <span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> j<span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;*&#39;</span><span class="token punctuation">,</span> end<span class="token operator">&#61;</span><span class="token string">&#39;&#39;</span><span class="token punctuation">)</span>
        i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    j <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718192702134.png" alt="在这里插入图片描述" /><br /> <strong>应用二&#xff1a;九九乘法表</strong></p> 
<pre><code class="prism language-python"><span class="token comment"># 重复打印9行表达式</span>
j <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">while</span> j <span class="token operator">&lt;&#61;</span> <span class="token number">9</span><span class="token punctuation">:</span>
    <span class="token comment"># 打印一行里面的表达式 a * b &#61; a*b</span>
    i <span class="token operator">&#61;</span> <span class="token number">1</span>
    <span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> j<span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;{i}*{j}&#61;{j*i}&#39;</span><span class="token punctuation">,</span> end<span class="token operator">&#61;</span><span class="token string">&#39;\t&#39;</span><span class="token punctuation">)</span>
        i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    j <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718192817742.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h3><a id="8_for_1006"></a>8. for循环</h3> 
<h4><a id="81__1007"></a>8.1 语法</h4> 
<pre><code class="prism language-python"><span class="token keyword">for</span> 临时变量 <span class="token keyword">in</span> 序列<span class="token punctuation">:</span>
    重复执行的代码<span class="token number">1</span>
    重复执行的代码<span class="token number">2</span>
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
</code></pre> 
<h4><a id="82__1015"></a>8.2 快速体验</h4> 
<pre><code class="prism language-python">str1 <span class="token operator">&#61;</span> <span class="token string">&#39;Hello World&#39;</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> str1<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718193008674.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h4><a id="83_break_1023"></a>8.3 break</h4> 
<pre><code class="prism language-python">str1 <span class="token operator">&#61;</span> <span class="token string">&#39;Hello World&#39;</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> str1<span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token string">&#39;e&#39;</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;遇到e不打印&#39;</span><span class="token punctuation">)</span>
        <span class="token keyword">break</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718193130752.png" alt="在这里插入图片描述" /></p> 
<h4><a id="84_continue_1034"></a>8.4 continue</h4> 
<pre><code class="prism language-python">str1 <span class="token operator">&#61;</span> <span class="token string">&#39;Hello World&#39;</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> str1<span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token string">&#39;e&#39;</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;遇到e不打印&#39;</span><span class="token punctuation">)</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718193216851.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h2><a id="else_1045"></a>十三、else</h2> 
<p>循环可以和else配合使用&#xff0c;else下方缩进的代码指的是<mark>当循环正常结束之后要执行的代码</mark>。</p> 
<h3><a id="1_whileelse_1047"></a>1. while…else</h3> 
<h4><a id="11__1048"></a>1.1 语法</h4> 
<pre><code class="prism language-python"><span class="token keyword">while</span> 条件<span class="token punctuation">:</span>
    条件成立重复执行的代码
<span class="token keyword">else</span><span class="token punctuation">:</span>
    循环正常结束之后要执行的代码
</code></pre> 
<h4><a id="12__1055"></a>1.2 示例</h4> 
<pre><code class="prism language-python">i <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">5</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Hello World&#39;</span><span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;执行完毕&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718193648276.png" alt="在这里插入图片描述" /></p> 
<h4><a id="13__1066"></a>1.3 退出循环的方式</h4> 
<ol><li>break终止循环</li></ol> 
<pre><code class="prism language-python">i <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">5</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token number">3</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;提前结束&#34;</span><span class="token punctuation">)</span>
        <span class="token keyword">break</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Hello World&#39;</span><span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;执行完毕&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718193909137.png" alt="在这里插入图片描述" /></p> 
<blockquote> 
 <p>所谓else指的是循环正常结束之后要执行的代码&#xff0c;即如果是break终止循环的情况&#xff0c;else下方缩进的代码将不执行。</p> 
</blockquote> 
<ol start="2"><li>continue控制循环</li></ol> 
<pre><code class="prism language-python">i <span class="token operator">&#61;</span> <span class="token number">1</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;&#61;</span> <span class="token number">5</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token number">3</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#34;打断一下&#34;</span><span class="token punctuation">)</span>
        i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Hello World&#39;</span><span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;执行完毕&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718194053236.png" alt="在这里插入图片描述" /></p> 
<blockquote> 
 <p>因为continue是退出当前一次循环&#xff0c;继续下一次循环&#xff0c;所以该循环在continue控制下是可以正常结束的&#xff0c;当循环结束后&#xff0c;则执行了else缩进的代码。</p> 
</blockquote> 
<h3><a id="2_forelse_1099"></a>2. for…else</h3> 
<h4><a id="21__1100"></a>2.1 语法</h4> 
<pre><code class="prism language-python"><span class="token keyword">for</span> 临时变量 <span class="token keyword">in</span> 序列<span class="token punctuation">:</span>
    重复执行的代码
    <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    循环正常结束之后要执行的代码
</code></pre> 
<blockquote> 
 <p>所谓else指的是循环正常结束之后要执行的代码&#xff0c;即如果是break终止循环的情况&#xff0c;else下方缩进的代码将不执行。</p> 
</blockquote> 
<h4><a id="22__1111"></a>2.2 示例</h4> 
<pre><code class="prism language-python">str1 <span class="token operator">&#61;</span> <span class="token string">&#39;Hello World&#39;</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> str1<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;循环正常结束之后执行的代码&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718194325854.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h4><a id="23__1121"></a>2.3 退出循环的方式</h4> 
<ol><li>break终止循环</li></ol> 
<pre><code class="prism language-python">str1 <span class="token operator">&#61;</span> <span class="token string">&#39;Hello World&#39;</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> str1<span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token string">&#39;e&#39;</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;遇到e不打印&#39;</span><span class="token punctuation">)</span>
        <span class="token keyword">break</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;循环正常结束之后执行的代码&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718194512861.png" alt="在这里插入图片描述" /></p> 
<blockquote> 
 <p>没有执行else缩进的代码。</p> 
</blockquote> 
<ol start="2"><li>continue控制循环</li></ol> 
<pre><code class="prism language-python">str1 <span class="token operator">&#61;</span> <span class="token string">&#39;Hello World&#39;</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> str1<span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&#61;&#61;</span> <span class="token string">&#39;e&#39;</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;遇到e不打印&#39;</span><span class="token punctuation">)</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;循环正常结束之后执行的代码&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718194628478.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<blockquote> 
 <p>因为continue是退出当前一次循环&#xff0c;继续下一次循环&#xff0c;所以该循环在continue控制下是可以正常结束的&#xff0c;当循环结束后&#xff0c;则执行了else缩进的代码。</p> 
</blockquote> 
<h2><a id="_1152"></a>十四、字符串</h2> 
<h3><a id="1__1153"></a>1. 认识字符串</h3> 
<p>字符串是 Python 中最常用的数据类型。我们一般使用引号来创建字符串。创建字符串很简单&#xff0c;只要为变量分配一个值即可。</p> 
<pre><code class="prism language-python">a <span class="token operator">&#61;</span> <span class="token string">&#39;hello world&#39;</span>
b <span class="token operator">&#61;</span> <span class="token string">&#34;abcdefg&#34;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;控制台显示结果为<code>&lt;class &#39;str&#39;&gt;</code>&#xff0c; 即数据类型为str(字符串)。</p> 
</blockquote> 
<h3><a id="2__1164"></a>2. 字符串特征</h3> 
<ul><li>一对引号字符串</li></ul> 
<pre><code class="prism language-python">name1 <span class="token operator">&#61;</span> <span class="token string">&#39;Tom&#39;</span>
name2 <span class="token operator">&#61;</span> <span class="token string">&#34;Rose&#34;</span>
</code></pre> 
<ul><li>三引号字符串</li></ul> 
<pre><code class="prism language-python">name3 <span class="token operator">&#61;</span> <span class="token triple-quoted-string string">&#39;&#39;&#39; Tom &#39;&#39;&#39;</span>
name4 <span class="token operator">&#61;</span> <span class="token triple-quoted-string string">&#34;&#34;&#34; Rose &#34;&#34;&#34;</span>
a <span class="token operator">&#61;</span> <span class="token triple-quoted-string string">&#39;&#39;&#39; i am Tom, 
        nice to meet you! &#39;&#39;&#39;</span>

b <span class="token operator">&#61;</span> <span class="token triple-quoted-string string">&#34;&#34;&#34; i am Rose, 
        nice to meet you! &#34;&#34;&#34;</span>
</code></pre> 
<p><strong>注意&#xff1a;三引号形式的字符串支持换行。</strong></p> 
<blockquote> 
 <p>思考&#xff1a;如果创建一个字符串<code>I&#39;m Tom</code>?</p> 
</blockquote> 
<pre><code class="prism language-python">c <span class="token operator">&#61;</span> <span class="token string">&#34;I&#39;m Tom&#34;</span>
d <span class="token operator">&#61;</span> <span class="token string">&#39;I\&#39;m Tom&#39;</span>
</code></pre> 
<h3><a id="3__1190"></a>3. 字符串输出</h3> 
<pre><code class="prism language-python"><span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;hello world&#39;</span><span class="token punctuation">)</span>

name <span class="token operator">&#61;</span> <span class="token string">&#39;Tom&#39;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;我的名字是%s&#39;</span> <span class="token operator">%</span> name<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;我的名字是{name}&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<h3><a id="4__1199"></a>4. 字符串输入</h3> 
<p>在Python中&#xff0c;使用<code>input()</code>接收用户输入。</p> 
<pre><code class="prism language-python">name <span class="token operator">&#61;</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请输入您的名字&#xff1a;&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您输入的名字是{name}&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>name<span class="token punctuation">)</span><span class="token punctuation">)</span>

password <span class="token operator">&#61;</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&#39;请输入您的密码&#xff1a;&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;您输入的密码是{password}&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>password<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200718195918184.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h3><a id="5__1212"></a>5. 下标</h3> 
<h4><a id="51__1213"></a>5.1 概念</h4> 
<p><code>“下标”</code>又叫<code>“索引”</code>&#xff0c;就是编号。比如火车座位号&#xff0c;座位号的作用&#xff1a;按照编号快速找到对应的座位。同理&#xff0c;下标的作用即是通过下标快速找到对应的数据。</p> 
<h4><a id="52__1216"></a>5.2 快速体验</h4> 
<p>需求&#xff1a;字符串<code>name &#61; &#34;abcdef&#34;</code>&#xff0c;取到不同下标对应的数据。</p> 
<ul><li>代码</li></ul> 
<pre><code class="prism language-python">name <span class="token operator">&#61;</span> <span class="token string">&#34;abcdef&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre> 
<ul><li>输出结果<br /> <img src="https://img-blog.csdnimg.cn/2020071820255627.png" alt="在这里插入图片描述" /></li></ul> 
<blockquote> 
 <p>注意&#xff1a;下标从<mark>0</mark>开始。<br /> <img src="https://img-blog.csdnimg.cn/20200718202624144.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
</blockquote> 
<h3><a id="6__1234"></a>6. 切片</h3> 
<p>切片是指对操作的对象截取其中一部分的操作。<strong>字符串、列表、元组</strong>都支持切片操作。</p> 
<h4><a id="61__1236"></a>6.1 语法</h4> 
<pre><code class="prism language-python">序列<span class="token punctuation">[</span>开始位置下标<span class="token punctuation">:</span>结束位置下标<span class="token punctuation">:</span>步长<span class="token punctuation">]</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;</p> 
 <ul><li>不包含结束位置下标对应的数据&#xff0c; 正负整数均可&#xff1b;<br /> 步长是选取间隔&#xff0c;正负整数均可&#xff0c;默认步长为1。</li></ul> 
</blockquote> 
<h4><a id="62__1246"></a>6.2 示例</h4> 
<pre><code class="prism language-python">name <span class="token operator">&#61;</span> <span class="token string">&#34;abcdefg&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">:</span><span class="token number">5</span><span class="token punctuation">:</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># cde</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">:</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># cde</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># abcde</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># bcdefg</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># abcdefg</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># aceg</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># abcdef, 负1表示倒数第一个数据</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">4</span><span class="token punctuation">:</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># def</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># gfedcba</span>
</code></pre> 
<h3><a id="7__1261"></a>7. 常用操作方法</h3> 
<p>字符串的常用操作方法有查找、修改和判断三大类。</p> 
<h4><a id="71__1263"></a>7.1 查找</h4> 
<p>所谓字符串查找方法即是查找子串在字符串中的位置或出现的次数。</p> 
<ul><li>find()&#xff1a;检测某个子串是否包含在这个字符串中&#xff0c;如果在返回这个子串开始的位置下标&#xff0c;否则则返回-1。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符串序列<span class="token punctuation">.</span>find<span class="token punctuation">(</span>子串<span class="token punctuation">,</span> 开始位置下标<span class="token punctuation">,</span> 结束位置下标<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;开始和结束位置下标可以省略&#xff0c;表示在整个字符串序列中查找。</p> 
</blockquote> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>find<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 12</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>find<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 22</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>find<span class="token punctuation">(</span><span class="token string">&#39;ands&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># -1</span>
</code></pre> 
<ul><li>index()&#xff1a;检测某个子串是否包含在这个字符串中&#xff0c;如果在返回这个子串开始的位置下标&#xff0c;否则则报异常。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符串序列<span class="token punctuation">.</span>index<span class="token punctuation">(</span>子串<span class="token punctuation">,</span> 开始位置下标<span class="token punctuation">,</span> 结束位置下标<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;开始和结束位置下标可以省略&#xff0c;表示在整个字符串序列中查找。</p> 
</blockquote> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 12</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 22</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token string">&#39;ands&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 报错</span>
</code></pre> 
<ul><li>rfind()&#xff1a; 和find()功能相同&#xff0c;但查找方向为<mark>右侧</mark>开始。</li><li>rindex()&#xff1a;和index()功能相同&#xff0c;但查找方向为<mark>右侧</mark>开始。</li><li>count()&#xff1a;返回某个子串在字符串中出现的次数。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符串序列<span class="token punctuation">.</span>count<span class="token punctuation">(</span>子串<span class="token punctuation">,</span> 开始位置下标<span class="token punctuation">,</span> 结束位置下标<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;开始和结束位置下标可以省略&#xff0c;表示在整个字符串序列中查找。</p> 
</blockquote> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>count<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 3</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>count<span class="token punctuation">(</span><span class="token string">&#39;ands&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 0</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>count<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 1</span>
</code></pre> 
<h4><a id="72__1323"></a>7.2 修改</h4> 
<p>所谓修改字符串&#xff0c;指的就是通过函数的形式修改字符串中的数据。</p> 
<ul><li>replace()&#xff1a;替换字符串。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符串序列<span class="token punctuation">.</span>replace<span class="token punctuation">(</span>旧子串<span class="token punctuation">,</span> 新子串<span class="token punctuation">,</span> 替换次数<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;替换次数如果查出子串出现次数&#xff0c;则替换次数为该子串出现次数。</p> 
</blockquote> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>replace<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;he&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;hello world he buran he list he Python</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>replace<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;he&#39;</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;hello world he buran he list he Python</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;hello world and buran and list and Python</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;数据按照是否能直接修改分为<mark>可变类型</mark>和<mark>不可变类型</mark>两种。字符串类型的数据修改的时候不能改变原有字符串&#xff0c;属于不能直接修改数据的类型即是不可变类型。</p> 
</blockquote> 
<ul><li>split()&#xff1a;按照指定字符分割字符串。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符串序列<span class="token punctuation">.</span>split<span class="token punctuation">(</span>分割字符<span class="token punctuation">,</span> num<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;num表示的是分割字符出现的次数&#xff0c;即将来返回数据个数为num&#43;1个。</p> 
</blockquote> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>split<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;[&#39;hello world &#39;, &#39; buran &#39;, &#39; list &#39;, &#39; Python&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>split<span class="token punctuation">(</span><span class="token string">&#39;and&#39;</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;[&#39;hello world &#39;, &#39; buran &#39;, &#39; list and Python&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>split<span class="token punctuation">(</span><span class="token string">&#39; &#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;[&#39;hello&#39;, &#39;world&#39;, &#39;and&#39;, &#39;buran&#39;, &#39;and&#39;, &#39;list&#39;, &#39;and&#39;, &#39;Python&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>split<span class="token punctuation">(</span><span class="token string">&#39; &#39;</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;[&#39;hello&#39;, &#39;world&#39;, &#39;and buran and list and Python&#39;]</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;如果分割字符是原有字符串中的子串&#xff0c;分割后则丢失该子串。</p> 
</blockquote> 
<ul><li>join()&#xff1a;用一个字符或子串合并字符串&#xff0c;即是将多个字符串合并为一个新的字符串。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符或子串<span class="token punctuation">.</span>join<span class="token punctuation">(</span>多字符串组成的序列<span class="token punctuation">)</span>
</code></pre> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;hello&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;buran&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;list&#39;</span><span class="token punctuation">]</span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;b&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;cc&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;ddd&#39;</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;_&#39;</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># hello_buran_list</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;...&#39;</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span>t1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;aa...b...cc...ddd</span>
</code></pre> 
<ul><li>capitalize()&#xff1a;将字符串第一个字符转换成大写。</li></ul> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>capitalize<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;Hello world and buran and list and python</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;capitalize()函数转换后&#xff0c;只字符串第一个字符大写&#xff0c;其他的字符全都小写。</p> 
</blockquote> 
<ul><li>title()&#xff1a;将字符串每个单词首字母转换成大写。</li></ul> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>title<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;Hello World And Buran And List And Python</span>
</code></pre> 
<ul><li>lower()&#xff1a;将字符串中大写转小写。</li></ul> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>lower<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;hello world and buran and list and python</span>
</code></pre> 
<ul><li>upper()&#xff1a;将字符串中小写转大写。</li></ul> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>upper<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;HELLO WORLD AND BURAN AND LIST AND PYTHON</span>
</code></pre> 
<ul><li>lstrip()&#xff1a;删除字符串左侧空白字符。</li><li>rstrip()&#xff1a;删除字符串右侧空白字符。</li><li>strip()&#xff1a;删除字符串两侧空白字符。</li><li>ljust()&#xff1a;返回一个原字符串左对齐,并使用指定字符(默认空格)填充至对应长度 的新字符串。</li><li>rjust()&#xff1a;返回一个原字符串右对齐,并使用指定字符(默认空格)填充至对应长度 的新字符串&#xff0c;语法和ljust()相同。</li><li>center()&#xff1a;返回一个原字符串居中对齐,并使用指定字符(默认空格)填充至对应长度 的新字符串&#xff0c;语法和ljust()相同。</li></ul> 
<h4><a id="73__1450"></a>7.3 判断</h4> 
<p>所谓判断即是判断真假&#xff0c;返回的结果是布尔型数据类型&#xff1a;True 或 False。</p> 
<ul><li>startswith()&#xff1a;检查字符串是否是以指定子串开头&#xff0c;是则返回 True&#xff0c;否则返回 False。如果设置开始和结束位置下标&#xff0c;则在指定范围内检查。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符串序列<span class="token punctuation">.</span>startswith<span class="token punctuation">(</span>子串<span class="token punctuation">,</span> 开始位置下标<span class="token punctuation">,</span> 结束位置下标<span class="token punctuation">)</span>
</code></pre> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>startswith<span class="token punctuation">(</span><span class="token string">&#39;hello&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>startswith<span class="token punctuation">(</span><span class="token string">&#39;hello&#39;</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;False</span>
</code></pre> 
<ul><li>endswith()&#xff1a;&#xff1a;检查字符串是否是以指定子串结尾&#xff0c;是则返回 True&#xff0c;否则返回 False。如果设置开始和结束位置下标&#xff0c;则在指定范围内检查。</li></ul> 
<ol><li>语法</li></ol> 
<pre><code class="prism language-python">字符串序列<span class="token punctuation">.</span>endswith<span class="token punctuation">(</span>子串<span class="token punctuation">,</span> 开始位置下标<span class="token punctuation">,</span> 结束位置下标<span class="token punctuation">)</span>
</code></pre> 
<ol start="2"><li>快速体验</li></ol> 
<pre><code class="prism language-python">mystr <span class="token operator">&#61;</span> <span class="token string">&#34;hello world and buran and list and Python&#34;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>endswith<span class="token punctuation">(</span><span class="token string">&#39;Python&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>endswith<span class="token punctuation">(</span><span class="token string">&#39;python&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr<span class="token punctuation">.</span>endswith<span class="token punctuation">(</span><span class="token string">&#39;Python&#39;</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;False</span>
</code></pre> 
<ul><li>isalpha()&#xff1a;如果字符串至少有一个字符并且所有字符都是字母则返回 True, 否则返回 False。</li></ul> 
<pre><code class="prism language-python">mystr1 <span class="token operator">&#61;</span> <span class="token string">&#39;hello&#39;</span>
mystr2 <span class="token operator">&#61;</span> <span class="token string">&#39;hello12345&#39;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr1<span class="token punctuation">.</span>isalpha<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr2<span class="token punctuation">.</span>isalpha<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;False</span>
</code></pre> 
<ul><li>isdigit()&#xff1a;如果字符串只包含数字则返回 True 否则返回 False。</li></ul> 
<pre><code class="prism language-python">mystr1 <span class="token operator">&#61;</span> <span class="token string">&#39;aaa12345&#39;</span>
mystr2 <span class="token operator">&#61;</span> <span class="token string">&#39;12345&#39;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr1<span class="token punctuation">.</span>isdigit<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a; False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr2<span class="token punctuation">.</span>isdigit<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;False</span>
</code></pre> 
<ul><li>isalnum()&#xff1a;如果字符串至少有一个字符并且所有字符都是字母或数字则返 回 True,否则返回 False。</li></ul> 
<pre><code class="prism language-python">mystr1 <span class="token operator">&#61;</span> <span class="token string">&#39;aaa12345&#39;</span>
mystr2 <span class="token operator">&#61;</span> <span class="token string">&#39;12345-&#39;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr1<span class="token punctuation">.</span>isalnum<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr2<span class="token punctuation">.</span>isalnum<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;False</span>
</code></pre> 
<ul><li>isspace()&#xff1a;如果字符串中只包含空白&#xff0c;则返回 True&#xff0c;否则返回 False。</li></ul> 
<pre><code class="prism language-python">mystr1 <span class="token operator">&#61;</span> <span class="token string">&#39;1 2 3 4 5&#39;</span>
mystr2 <span class="token operator">&#61;</span> <span class="token string">&#39;     &#39;</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>mystr1<span class="token punctuation">.</span>isspace<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>mystr2<span class="token punctuation">.</span>isspace<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># 结果&#xff1a;True</span>
</code></pre> 
<h2><a id="_1532"></a>十五、列表</h2> 
<h3><a id="1__1533"></a>1. 列表的格式</h3> 
<pre><code class="prism language-python"><span class="token punctuation">[</span>数据<span class="token number">1</span><span class="token punctuation">,</span> 数据<span class="token number">2</span><span class="token punctuation">,</span> 数据<span class="token number">3</span><span class="token punctuation">,</span> 数据<span class="token number">4</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">]</span>
</code></pre> 
<p><strong>列表可以一次性有序存储多个不同类型的数据。</strong></p> 
<h3><a id="2__1538"></a>2. 列表的常用操作</h3> 
<p>列表的作用是一次性存储多个数据&#xff0c;程序员可以对这些数据进行的操作有&#xff1a;增、删、改、查。</p> 
<h4><a id="21__1540"></a>2.1 查找</h4> 
<ol><li>下标</li></ol> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># Tom</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># Lily</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># Rose</span>
</code></pre> 
<ol start="2"><li>函数</li></ol> 
<ul><li>index()&#xff1a;返回指定数据所在位置的下标 。</li></ul> 
<pre><code class="prism language-python">列表序列<span class="token punctuation">.</span>index<span class="token punctuation">(</span>数据<span class="token punctuation">,</span> 开始位置下标<span class="token punctuation">,</span> 结束位置下标<span class="token punctuation">)</span>
</code></pre> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 1</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;如果查找的数据不存在则报错。</p> 
</blockquote> 
<ul><li>count()&#xff1a;统计指定数据在当前列表中出现的次数。</li></ul> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">.</span>count<span class="token punctuation">(</span><span class="token string">&#39;Lily&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 1</span>
</code></pre> 
<ul><li>len()&#xff1a;访问列表长度&#xff0c;即列表中数据的个数。</li></ul> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 3</span>
</code></pre> 
<h4><a id="22__1578"></a>2.2 判断是否存在</h4> 
<ul><li>in&#xff1a;判断指定数据在某个列表序列&#xff0c;如果在返回True&#xff0c;否则返回False。</li></ul> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token comment"># 结果&#xff1a;True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Lily&#39;</span> <span class="token keyword">in</span> name_list<span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Lilys&#39;</span> <span class="token keyword">in</span> name_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>not in&#xff1a;判断指定数据不在某个列表序列&#xff0c;如果不在返回True&#xff0c;否则返回False。</li></ul> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token comment"># 结果&#xff1a;False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Lily&#39;</span> <span class="token operator">not</span> <span class="token keyword">in</span> name_list<span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;Lilys&#39;</span> <span class="token operator">not</span> <span class="token keyword">in</span> name_list<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="22__1601"></a>2.2 增加</h4> 
<p><strong>作用&#xff1a;增加指定数据到列表中。</strong></p> 
<ul><li>append()&#xff1a;列表结尾追加数据。</li></ul> 
<pre><code class="prism language-python">列表序列<span class="token punctuation">.</span>append<span class="token punctuation">(</span>数据<span class="token punctuation">)</span>
</code></pre> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">&#39;xiaoming&#39;</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;Lily&#39;, &#39;Rose&#39;, &#39;xiaoming&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>列表追加数据的时候&#xff0c;直接在原列表里面追加了指定数据&#xff0c;即修改了原列表&#xff0c;故列表为可变类型数据。</p> 
</blockquote> 
<p><strong>注意点&#xff1a;如果append()追加的数据是一个序列&#xff0c;则追加整个序列到列表。</strong></p> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">&#39;xiaoming&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;xiaohong&#39;</span><span class="token punctuation">]</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;Lily&#39;, &#39;Rose&#39;, [&#39;xiaoming&#39;, &#39;xiaohong&#39;]]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>extend()&#xff1a;列表结尾追加数据&#xff0c;如果数据是一个序列&#xff0c;则将这个序列的数据逐一添加到列表。</li></ul> 
<pre><code class="prism language-python">列表序列<span class="token punctuation">.</span>extend<span class="token punctuation">(</span>数据<span class="token punctuation">)</span>
</code></pre> 
<p>单个数据&#xff1a;</p> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">.</span>extend<span class="token punctuation">(</span><span class="token string">&#39;xiaoming&#39;</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;Lily&#39;, &#39;Rose&#39;, &#39;x&#39;, &#39;i&#39;, &#39;a&#39;, &#39;o&#39;, &#39;m&#39;, &#39;i&#39;, &#39;n&#39;, &#39;g&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<p>序列数据&#xff1a;</p> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">.</span>extend<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">&#39;xiaoming&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;xiaohong&#39;</span><span class="token punctuation">]</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;Lily&#39;, &#39;Rose&#39;, &#39;xiaoming&#39;, &#39;xiaohong&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>insert()&#xff1a;指定位置新增数据。</li></ul> 
<pre><code class="prism language-python">列表序列<span class="token punctuation">.</span>insert<span class="token punctuation">(</span>位置下标<span class="token punctuation">,</span> 数据<span class="token punctuation">)</span>
</code></pre> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">.</span>insert<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">&#39;xiaoming&#39;</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;xiaoming&#39;, &#39;Lily&#39;, &#39;Rose&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="23__1669"></a>2.3 删除</h4> 
<ul><li>del</li></ul> 
<pre><code class="prism language-python"><span class="token keyword">del</span> 目标
<span class="token comment"># del(目标)</span>
</code></pre> 
<p>删除列表&#xff1a;</p> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token comment"># 结果&#xff1a;报错提示&#xff1a;name &#39;name_list&#39; is not defined</span>
<span class="token keyword">del</span> name_list
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<p>删除指定数据&#xff1a;</p> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token keyword">del</span> name_list<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>

<span class="token comment"># 结果&#xff1a;[&#39;Lily&#39;, &#39;Rose&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>pop()&#xff1a;删除指定下标的数据(默认为最后一个)&#xff0c;并返回该数据。</li></ul> 
<pre><code class="prism language-python">列表序列<span class="token punctuation">.</span>pop<span class="token punctuation">(</span>下标<span class="token punctuation">)</span>
</code></pre> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

del_name <span class="token operator">&#61;</span> name_list<span class="token punctuation">.</span>pop<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;Lily</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>del_name<span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;Rose&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>remove()&#xff1a;移除列表中某个数据的第一个匹配项。</li></ul> 
<pre><code class="prism language-python">列表序列<span class="token punctuation">.</span>remove<span class="token punctuation">(</span>数据<span class="token punctuation">)</span>
</code></pre> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">.</span>remove<span class="token punctuation">(</span><span class="token string">&#39;Rose&#39;</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;Lily&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>clear()&#xff1a;清空列表</li></ul> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">.</span>clear<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span> <span class="token comment"># 结果&#xff1a; []</span>
</code></pre> 
<h4><a id="24__1734"></a>2.4 修改</h4> 
<ul><li>修改指定下标数据</li></ul> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_list<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&#61;</span> <span class="token string">&#39;aaa&#39;</span>

<span class="token comment"># 结果&#xff1a;[&#39;aaa&#39;, &#39;Lily&#39;, &#39;Rose&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>逆置&#xff1a;reverse()</li></ul> 
<pre><code class="prism language-python">num_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">]</span>

num_list<span class="token punctuation">.</span>reverse<span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[8, 6, 3, 2, 5, 1]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>num_list<span class="token punctuation">)</span>
</code></pre> 
<ul><li>排序&#xff1a;sort()</li></ul> 
<pre><code class="prism language-python">列表序列<span class="token punctuation">.</span>sort<span class="token punctuation">(</span> key<span class="token operator">&#61;</span><span class="token boolean">None</span><span class="token punctuation">,</span> reverse<span class="token operator">&#61;</span><span class="token boolean">False</span><span class="token punctuation">)</span>
</code></pre> 
<pre><code class="prism language-python">num_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">]</span>

num_list<span class="token punctuation">.</span>sort<span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[1, 2, 3, 5, 6, 8]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>num_list<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;reverse表示排序规则&#xff0c;<strong>reverse &#61; True</strong> 降序&#xff0c; <strong>reverse &#61; False</strong> 升序&#xff08;默认&#xff09;</p> 
</blockquote> 
<h4><a id="25__1771"></a>2.5 复制</h4> 
<ul><li>函数&#xff1a;copy()</li></ul> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

name_li2 <span class="token operator">&#61;</span> name_list<span class="token punctuation">.</span>copy<span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token comment"># 结果&#xff1a;[&#39;Tom&#39;, &#39;Lily&#39;, &#39;Rose&#39;]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_li2<span class="token punctuation">)</span>
</code></pre> 
<h3><a id="3__1782"></a>3. 列表的循环遍历</h3> 
<p>需求&#xff1a;依次打印列表中的各个数据。</p> 
<h4><a id="31_while_1784"></a>3.1 while</h4> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

i <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;</span> <span class="token builtin">len</span><span class="token punctuation">(</span>name_list<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>
</code></pre> 
<h4><a id="32_for_1794"></a>3.2 for</h4> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span>

<span class="token keyword">for</span> i <span class="token keyword">in</span> name_list<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre> 
<h3><a id="4__1802"></a>4. 列表嵌套</h3> 
<p>所谓列表嵌套指的就是一个列表里面包含了其他的子列表。</p> 
<p>应用场景&#xff1a;要存储班级一、二、三三个班级学生姓名&#xff0c;且每个班级的学生姓名在一个列表。</p> 
<pre><code class="prism language-python">name_list <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&#39;小明&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;小红&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;小绿&#39;</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Lily&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">&#39;张三&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;李四&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;王五&#39;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
</code></pre> 
<blockquote> 
 <p>思考&#xff1a; 如何查找到数据&#34;李四&#34;&#xff1f;</p> 
</blockquote> 
<pre><code class="prism language-python"><span class="token comment"># 第一步&#xff1a;按下标查找到李四所在的列表</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>

<span class="token comment"># 第二步&#xff1a;从李四所在的列表里面&#xff0c;再按下标找到数据李四</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>name_list<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre> 
<h2><a id="_1820"></a>十六、元组</h2> 
<p><strong>一个元组可以存储多个数据&#xff0c;元组内的数据是不能修改的。</strong></p> 
<h3><a id="1__1822"></a>1. 定义元组</h3> 
<p>元组特点&#xff1a;定义元组使用<mark>小括号</mark>&#xff0c;且<mark>逗号</mark>隔开各个数据&#xff0c;数据可以是不同的数据类型。</p> 
<pre><code class="prism language-python"><span class="token comment"># 多个数据元组</span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">)</span>

<span class="token comment"># 单个数据元组</span>
t2 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;如果定义的元组只有一个数据&#xff0c;那么这个数据后面也好添加逗号&#xff0c;否则数据类型为唯一的这个数据的数据类型。</p> 
</blockquote> 
<pre><code class="prism language-python">t2 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>t2<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># tuple</span>

t3 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>t3<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># int</span>

t4 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;hello&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>t4<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># str</span>
</code></pre> 
<h3><a id="2__1844"></a>2. 元组的常见操作</h3> 
<p>元组数据不支持修改&#xff0c;只支持查找&#xff0c;具体如下&#xff1a;</p> 
<ul><li>按下标查找数据</li></ul> 
<pre><code class="prism language-python">tuple1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;cc&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>tuple1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># aa</span>
</code></pre> 
<ul><li>index()&#xff1a;查找某个数据&#xff0c;如果数据存在返回对应的下标&#xff0c;否则报错&#xff0c;语法和列表、字符串的index方法相同。</li></ul> 
<pre><code class="prism language-python">tuple1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;cc&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>tuple1<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 0</span>
</code></pre> 
<ul><li>count()&#xff1a;统计某个数据在当前元组出现的次数。</li></ul> 
<pre><code class="prism language-python">tuple1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;cc&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>tuple1<span class="token punctuation">.</span>count<span class="token punctuation">(</span><span class="token string">&#39;bb&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 2</span>
</code></pre> 
<ul><li>len()&#xff1a;统计元组中数据的个数。</li></ul> 
<pre><code class="prism language-python">tuple1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;cc&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>tuple1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 4</span>
</code></pre> 
<h3><a id="3__1871"></a>3. 元组的注意事项</h3> 
<p><strong>元组内的直接数据如果修改则立即报错。</strong></p> 
<pre><code class="prism language-python">tuple1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;cc&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">)</span>
tuple1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&#61;</span> <span class="token string">&#39;aaa&#39;</span>
</code></pre> 
<p><strong>但是如果元组里面有列表&#xff0c;修改列表里面的数据则是支持的&#xff0c;故自觉很重要。</strong></p> 
<pre><code class="prism language-python">tuple2 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">&#39;aa&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;bb&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;cc&#39;</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>tuple2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># 访问到列表</span>

<span class="token comment"># 结果&#xff1a;(10, 20, [&#39;aaaaa&#39;, &#39;bb&#39;, &#39;cc&#39;], 50, 30)</span>
tuple2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&#61;</span> <span class="token string">&#39;aaaaa&#39;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>tuple2<span class="token punctuation">)</span>
</code></pre> 
<h2><a id="_1888"></a>十七、字典</h2> 
<p><strong>字典里面的数据是以“键值对”形式出现&#xff0c;字典数据和数据顺序没有关系&#xff0c;即字典不支持下标&#xff0c;后期无论数据如何变化&#xff0c;只需要按照对应的键的名字查找数据即可。</strong></p> 
<h3><a id="1__1890"></a>1. 创建字典的语法</h3> 
<p>字典特点&#xff1a;</p> 
<ul><li>符号为<mark>大括号</mark></li><li>数据为<mark>键值对</mark>形式出现</li><li>各个键值对之间用<mark>逗号</mark>隔开</li></ul> 
<pre><code class="prism language-python"><span class="token comment"># 有数据字典</span>
dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>

<span class="token comment"># 空字典</span>
dict2 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">}</span>

dict3 <span class="token operator">&#61;</span> <span class="token builtin">dict</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;一般称冒号前面的为键(key)&#xff0c;简称k&#xff1b;冒号后面的为值(value)&#xff0c;简称v。</p> 
</blockquote> 
<h3><a id="2__1909"></a>2. 字典常见操作</h3> 
<h4><a id="21__1910"></a>2.1 增</h4> 
<p>写法&#xff1a;<mark>字典序列[key] &#61; 值</mark></p> 
<blockquote> 
 <p>注意&#xff1a;如果key存在则修改这个key对应的值&#xff1b;如果key不存在则新增此键值对。</p> 
</blockquote> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>

dict1<span class="token punctuation">[</span><span class="token string">&#39;name&#39;</span><span class="token punctuation">]</span> <span class="token operator">&#61;</span> <span class="token string">&#39;Rose&#39;</span>
<span class="token comment"># 结果&#xff1a;{&#39;name&#39;: &#39;Rose&#39;, &#39;age&#39;: 20, &#39;gender&#39;: &#39;男&#39;}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">)</span>

dict1<span class="token punctuation">[</span><span class="token string">&#39;id&#39;</span><span class="token punctuation">]</span> <span class="token operator">&#61;</span> <span class="token number">110</span>

<span class="token comment"># {&#39;name&#39;: &#39;Rose&#39;, &#39;age&#39;: 20, &#39;gender&#39;: &#39;男&#39;, &#39;id&#39;: 110}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;字典为可变类型。</p> 
</blockquote> 
<h4><a id="22__1928"></a>2.2 删</h4> 
<ul><li>del() / del&#xff1a;删除字典或删除字典中指定键值对。</li></ul> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>

<span class="token keyword">del</span> dict1<span class="token punctuation">[</span><span class="token string">&#39;gender&#39;</span><span class="token punctuation">]</span>
<span class="token comment"># 结果&#xff1a;{&#39;name&#39;: &#39;Tom&#39;, &#39;age&#39;: 20}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">)</span>
</code></pre> 
<ul><li>clear()&#xff1a;清空字典</li></ul> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>

dict1<span class="token punctuation">.</span>clear<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">)</span>  <span class="token comment"># {}</span>
</code></pre> 
<h4><a id="23__1947"></a>2.3 改</h4> 
<p>写法&#xff1a;<mark>字典序列[key] &#61; 值</mark></p> 
<blockquote> 
 <p>注意&#xff1a;如果key存在则修改这个key对应的值 &#xff1b;如果key不存在则新增此键值对。</p> 
</blockquote> 
<h4><a id="24__1951"></a>2.4 查</h4> 
<ol><li>key值查找</li></ol> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">[</span><span class="token string">&#39;name&#39;</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># Tom</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">[</span><span class="token string">&#39;id&#39;</span><span class="token punctuation">]</span><span class="token punctuation">)</span>  <span class="token comment"># 报错</span>
</code></pre> 
<blockquote> 
 <p>如果当前查找的key存在&#xff0c;则返回对应的值&#xff1b;否则则报错。</p> 
</blockquote> 
<ol start="2"><li>get()</li></ol> 
<pre><code class="prism language-python">字典序列<span class="token punctuation">.</span>get<span class="token punctuation">(</span>key<span class="token punctuation">,</span> 默认值<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;如果当前查找的key不存在则返回第二个参数(默认值)&#xff0c;如果省略第二个参数&#xff0c;则返回None。</p> 
</blockquote> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">&#39;name&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># Tom</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">&#39;id&#39;</span><span class="token punctuation">,</span> <span class="token number">110</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 110</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">&#39;id&#39;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># None</span>
</code></pre> 
<ol start="3"><li>keys()</li></ol> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">.</span>keys<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># dict_keys([&#39;name&#39;, &#39;age&#39;, &#39;gender&#39;])</span>
</code></pre> 
<ol start="4"><li>values()</li></ol> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">.</span>values<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># dict_values([&#39;Tom&#39;, 20, &#39;男&#39;])</span>
</code></pre> 
<ol start="5"><li>items()</li></ol> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">.</span>items<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># dict_items([(&#39;name&#39;, &#39;Tom&#39;), (&#39;age&#39;, 20), (&#39;gender&#39;, &#39;男&#39;)])</span>
</code></pre> 
<h3><a id="3__1992"></a>3. 字典的循环遍历</h3> 
<h4><a id="31_key_1993"></a>3.1 遍历字典的key</h4> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">for</span> key <span class="token keyword">in</span> dict1<span class="token punctuation">.</span>keys<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>key<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="32_value_2000"></a>3.2 遍历字典的value</h4> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">for</span> value <span class="token keyword">in</span> dict1<span class="token punctuation">.</span>values<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="33__2007"></a>3.3 遍历字典的元素</h4> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">for</span> item <span class="token keyword">in</span> dict1<span class="token punctuation">.</span>items<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>item<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="34__2014"></a>3.4 遍历字典的键值对</h4> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;男&#39;</span><span class="token punctuation">}</span>
<span class="token keyword">for</span> key<span class="token punctuation">,</span> value <span class="token keyword">in</span> dict1<span class="token punctuation">.</span>items<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;{key} &#61; {value}&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<h2><a id="_2021"></a>十八、集合</h2> 
<p><strong>集合具有确定性&#xff0c;无序性和去重性。</strong></p> 
<h3><a id="1__2023"></a>1. 创建集合</h3> 
<p>创建集合使用<code>{}</code>或<code>set()</code>&#xff0c; 但是如果要创建空集合只能使用<code>set()</code>&#xff0c;因为<code>{}</code>用来创建空字典。</p> 
<pre><code class="prism language-python">s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>

s2 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s2<span class="token punctuation">)</span>

s3 <span class="token operator">&#61;</span> <span class="token builtin">set</span><span class="token punctuation">(</span><span class="token string">&#39;abcdefg&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s3<span class="token punctuation">)</span>

s4 <span class="token operator">&#61;</span> <span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>s4<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># set</span>

s5 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">type</span><span class="token punctuation">(</span>s5<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># dict</span>
</code></pre> 
<blockquote> 
 <p>特点&#xff1a;</p> 
 <ol><li>集合可以去掉重复数据&#xff1b;</li><li>集合数据是无序的&#xff0c;故不支持下标。</li></ol> 
</blockquote> 
<h3><a id="2__2047"></a>2. 集合常见操作方法</h3> 
<h4><a id="21__2048"></a>2.1 增加数据</h4> 
<ul><li>add()</li></ul> 
<pre><code class="prism language-python">s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">}</span>
s1<span class="token punctuation">.</span>add<span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
s1<span class="token punctuation">.</span>add<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>  <span class="token comment"># {100, 10, 20}</span>
</code></pre> 
<blockquote> 
 <p>因为集合有去重功能&#xff0c;所以&#xff0c;当向集合内追加的数据是当前集合已有数据的话&#xff0c;则不进行任何操作。</p> 
</blockquote> 
<ul><li>update(), 追加的数据是序列。</li></ul> 
<pre><code class="prism language-python">s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">}</span>
<span class="token comment"># s1.update(100)  # 报错</span>
s1<span class="token punctuation">.</span>update<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
s1<span class="token punctuation">.</span>update<span class="token punctuation">(</span><span class="token string">&#39;abc&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>   <span class="token comment"># {&#39;a&#39;, 100, 200, 10, &#39;b&#39;, &#39;c&#39;, 20}</span>
</code></pre> 
<h4><a id="22__2070"></a>2.2 删除数据</h4> 
<ul><li>remove()&#xff0c;删除集合中的指定数据&#xff0c;如果数据不存在则报错。</li></ul> 
<pre><code class="prism language-python">s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">}</span>

s1<span class="token punctuation">.</span>remove<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>

s1<span class="token punctuation">.</span>remove<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>  <span class="token comment"># 报错</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>
</code></pre> 
<ul><li>discard()&#xff0c;删除集合中的指定数据&#xff0c;如果数据不存在也不会报错。</li></ul> 
<pre><code class="prism language-python">s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">}</span>

s1<span class="token punctuation">.</span>discard<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>

s1<span class="token punctuation">.</span>discard<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>
</code></pre> 
<ul><li>pop()&#xff0c;随机删除集合中的某个数据&#xff0c;并返回这个数据。</li></ul> 
<pre><code class="prism language-python">s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">}</span>

del_num <span class="token operator">&#61;</span> s1<span class="token punctuation">.</span>pop<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>del_num<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="23__2109"></a>2.3 查找数据</h4> 
<ul><li>in&#xff1a;判断数据在集合序列</li><li>not in&#xff1a;判断数据不在集合序列</li></ul> 
<pre><code class="prism language-python">s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">}</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token number">10</span> <span class="token keyword">in</span> s1<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token number">10</span> <span class="token operator">not</span> <span class="token keyword">in</span> s1<span class="token punctuation">)</span>
</code></pre> 
<h2><a id="_2120"></a>十九、公共操作</h2> 
<h3><a id="1__2121"></a>1. 运算符</h3> 
<table><thead><tr><th align="center">运算符</th><th align="center">描述</th><th align="center">支持的容器类型</th></tr></thead><tbody><tr><td align="center">&#43;</td><td align="center">合并</td><td align="center">字符串、列表、元组</td></tr><tr><td align="center">*</td><td align="center">复制</td><td align="center">字符串、列表、元组</td></tr><tr><td align="center">in</td><td align="center">元素是否存在</td><td align="center">字符串、列表、元组、字典</td></tr><tr><td align="center">not in</td><td align="center">元素是否不存在</td><td align="center">字符串、列表、元组、字典</td></tr></tbody></table>
<h4><a id="11__2129"></a>1.1 &#43;</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1. 字符串 </span>
str1 <span class="token operator">&#61;</span> <span class="token string">&#39;aa&#39;</span>
str2 <span class="token operator">&#61;</span> <span class="token string">&#39;bb&#39;</span>
str3 <span class="token operator">&#61;</span> str1 <span class="token operator">&#43;</span> str2
<span class="token keyword">print</span><span class="token punctuation">(</span>str3<span class="token punctuation">)</span>  <span class="token comment"># aabb</span>


<span class="token comment"># 2. 列表 </span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span>
list2 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">]</span>
list3 <span class="token operator">&#61;</span> list1 <span class="token operator">&#43;</span> list2
<span class="token keyword">print</span><span class="token punctuation">(</span>list3<span class="token punctuation">)</span>  <span class="token comment"># [1, 2, 10, 20]</span>

<span class="token comment"># 3. 元组 </span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span>
t2 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span>
t3 <span class="token operator">&#61;</span> t1 <span class="token operator">&#43;</span> t2
<span class="token keyword">print</span><span class="token punctuation">(</span>t3<span class="token punctuation">)</span>  <span class="token comment"># (10, 20, 100, 200)</span>
</code></pre> 
<h4><a id="12__2151"></a>1.2 *</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1. 字符串</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;-&#39;</span> <span class="token operator">*</span> <span class="token number">10</span><span class="token punctuation">)</span>  <span class="token comment"># ----------</span>

<span class="token comment"># 2. 列表</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;hello&#39;</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>list1 <span class="token operator">*</span> <span class="token number">4</span><span class="token punctuation">)</span>  <span class="token comment"># [&#39;hello&#39;, &#39;hello&#39;, &#39;hello&#39;, &#39;hello&#39;]</span>

<span class="token comment"># 3. 元组</span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;world&#39;</span><span class="token punctuation">,</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>t1 <span class="token operator">*</span> <span class="token number">4</span><span class="token punctuation">)</span>  <span class="token comment"># (&#39;world&#39;, &#39;world&#39;, &#39;world&#39;, &#39;world&#39;)</span>
</code></pre> 
<h4><a id="13_innot_in_2165"></a>1.3 in或not in</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1. 字符串</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;a&#39;</span> <span class="token keyword">in</span> <span class="token string">&#39;abcd&#39;</span><span class="token punctuation">)</span>  <span class="token comment"># True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;a&#39;</span> <span class="token operator">not</span> <span class="token keyword">in</span> <span class="token string">&#39;abcd&#39;</span><span class="token punctuation">)</span>  <span class="token comment"># False</span>

<span class="token comment"># 2. 列表</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;a&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;b&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;c&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;d&#39;</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;a&#39;</span> <span class="token keyword">in</span> list1<span class="token punctuation">)</span>  <span class="token comment"># True</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;a&#39;</span> <span class="token operator">not</span> <span class="token keyword">in</span> list1<span class="token punctuation">)</span>  <span class="token comment"># False</span>

<span class="token comment"># 3. 元组</span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;a&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;b&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;c&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;d&#39;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span> <span class="token keyword">in</span> t1<span class="token punctuation">)</span>  <span class="token comment"># False</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&#39;aa&#39;</span> <span class="token operator">not</span> <span class="token keyword">in</span> t1<span class="token punctuation">)</span>  <span class="token comment"># True</span>
</code></pre> 
<h3><a id="2__2182"></a>2. 公共方法</h3> 
<table><thead><tr><th>函数</th><th>描述</th></tr></thead><tbody><tr><td>len()</td><td>计算容器中元素个数</td></tr><tr><td>del 或 del()</td><td>删除</td></tr><tr><td>max()</td><td>返回容器中元素最大值</td></tr><tr><td>min()</td><td>返回容器中元素最小值</td></tr><tr><td>range(start, end, step)</td><td>生成从start到end的数字&#xff0c;步长为 step&#xff0c;供for循环使用</td></tr><tr><td>enumerate()</td><td>函数用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列&#xff0c;同时列出数据和数据下标&#xff0c;一般用在 for 循环当中。</td></tr></tbody></table>
<h4><a id="21_len_2191"></a>2.1 len()</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1. 字符串</span>
str1 <span class="token operator">&#61;</span> <span class="token string">&#39;abcdefg&#39;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>str1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 7</span>

<span class="token comment"># 2. 列表</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 4</span>

<span class="token comment"># 3. 元组</span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>t1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 5</span>

<span class="token comment"># 4. 集合</span>
s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 3</span>

<span class="token comment"># 5. 字典</span>
dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;name&#39;</span><span class="token punctuation">:</span> <span class="token string">&#39;Rose&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">:</span> <span class="token number">18</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>dict1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 2</span>
</code></pre> 
<h4><a id="22_del_2214"></a>2.2 del()</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1. 字符串</span>
str1 <span class="token operator">&#61;</span> <span class="token string">&#39;abcdefg&#39;</span>
<span class="token keyword">del</span> str1
<span class="token keyword">print</span><span class="token punctuation">(</span>str1<span class="token punctuation">)</span>

<span class="token comment"># 2. 列表</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">]</span>
<span class="token keyword">del</span><span class="token punctuation">(</span>list1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span>  <span class="token comment"># [20, 30, 40]</span>
</code></pre> 
<h4><a id="23_max_2227"></a>2.3 max()</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1. 字符串</span>
str1 <span class="token operator">&#61;</span> <span class="token string">&#39;abcdefg&#39;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">max</span><span class="token punctuation">(</span>str1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># g</span>

<span class="token comment"># 2. 列表</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">max</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 40</span>
</code></pre> 
<h4><a id="24_min_2238"></a>2.4 min()</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1. 字符串</span>
str1 <span class="token operator">&#61;</span> <span class="token string">&#39;abcdefg&#39;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">min</span><span class="token punctuation">(</span>str1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># a</span>

<span class="token comment"># 2. 列表</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">min</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 10</span>
</code></pre> 
<h4><a id="25_range_2249"></a>2.5 range()</h4> 
<pre><code class="prism language-python"><span class="token comment"># 1 2 3 4 5 6 7 8 9</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>

<span class="token comment"># 1 3 5 7 9</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>

<span class="token comment"># 0 1 2 3 4 5 6 7 8 9</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;range()生成的序列不包含end数字。</p> 
</blockquote> 
<h4><a id="26_enumerate_2266"></a>2.6 enumerate()</h4> 
<pre><code class="prism language-python"><span class="token builtin">enumerate</span><span class="token punctuation">(</span>可遍历对象<span class="token punctuation">,</span> start<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;start参数用来设置遍历数据的下标的起始值&#xff0c;默认为0。</p> 
</blockquote> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;a&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;b&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;c&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;d&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;e&#39;</span><span class="token punctuation">]</span>

<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">enumerate</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>

<span class="token keyword">for</span> index<span class="token punctuation">,</span> char <span class="token keyword">in</span> <span class="token builtin">enumerate</span><span class="token punctuation">(</span>list1<span class="token punctuation">,</span> start<span class="token operator">&#61;</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>f<span class="token string">&#39;下标是{index}, 对应的字符是{char}&#39;</span><span class="token punctuation">)</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20200724200540723.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h3><a id="3__2284"></a>3. 容器类型转换</h3> 
<h4><a id="31_tuple_2285"></a>3.1 tuple()</h4> 
<p><strong>作用&#xff1a;将某个序列转换成元组。</strong></p> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">]</span>
s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">,</span> <span class="token number">400</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">}</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">tuple</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">tuple</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<h4><a id="32_list_2295"></a>3.2 list()</h4> 
<p><strong>作用&#xff1a;将某个序列转换成列表。</strong></p> 
<pre><code class="prism language-python">t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;a&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;b&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;c&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;d&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;e&#39;</span><span class="token punctuation">)</span>
s1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">,</span> <span class="token number">400</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">}</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>t1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>s1<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<h4><a id="33_set_2305"></a>3.3 set()</h4> 
<p><strong>作用&#xff1a;将某个序列转换成集合。</strong></p> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">]</span>
t1 <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token string">&#39;a&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;b&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;c&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;d&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;e&#39;</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">set</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">set</span><span class="token punctuation">(</span>t1<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;</p> 
 <ol><li>集合可以快速完成列表去重。</li><li>集合不支持下标。</li></ol> 
</blockquote> 
<h2><a id="_2319"></a>二十、推导式</h2> 
<h3><a id="1__2320"></a>1. 列表推导式</h3> 
<p><strong>作用&#xff1a;用一个表达式创建一个有规律的列表或控制一个有规律列表。</strong></p> 
<p><mark>列表推导式又叫列表生成式。</mark></p> 
<h4><a id="11__2325"></a>1.1 快速体验</h4> 
<p>需求&#xff1a;创建一个0-10的列表。</p> 
<ul><li>while循环实现</li></ul> 
<pre><code class="prism language-python"><span class="token comment"># 1. 准备一个空列表</span>
list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>

<span class="token comment"># 2. 书写循环&#xff0c;依次追加数字到空列表list1中</span>
i <span class="token operator">&#61;</span> <span class="token number">0</span>
<span class="token keyword">while</span> i <span class="token operator">&lt;</span> <span class="token number">10</span><span class="token punctuation">:</span>
    list1<span class="token punctuation">.</span>append<span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    i <span class="token operator">&#43;&#61;</span> <span class="token number">1</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span>
</code></pre> 
<ul><li>for循环实现</li></ul> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    list1<span class="token punctuation">.</span>append<span class="token punctuation">(</span>i<span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span>
</code></pre> 
<ul><li>列表推导式实现</li></ul> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span>i <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="12_if_2358"></a>1.2 带if的列表推导式</h4> 
<p>需求&#xff1a;创建0-10的偶数列表</p> 
<ul><li>方法一&#xff1a;range()步长实现</li></ul> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span>i <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span>
</code></pre> 
<ul><li>方法二&#xff1a;if实现</li></ul> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span>i <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span> <span class="token keyword">if</span> i <span class="token operator">%</span> <span class="token number">2</span> <span class="token operator">&#61;&#61;</span> <span class="token number">0</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span>
</code></pre> 
<h4><a id="13_for_2373"></a>1.3 多个for循环实现列表推导式</h4> 
<p>需求&#xff1a;创建列表如下&#xff1a;</p> 
<pre><code class="prism language-python"><span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
</code></pre> 
<ul><li>代码如下&#xff1a;</li></ul> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span> j<span class="token punctuation">)</span> <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">)</span> <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span>
</code></pre> 
<h3><a id="2__2385"></a>2. 字典推导式</h3> 
<p><strong>字典推导式作用&#xff1a;快速合并列表为字典或提取字典中目标数据。</strong></p> 
<h4><a id="21__2387"></a>2.1 快速体验</h4> 
<ol><li>创建一个字典&#xff1a;字典key是1-5数字&#xff0c;value是这个数字的2次方。</li></ol> 
<pre><code class="prism language-python">dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span>i<span class="token punctuation">:</span> i<span class="token operator">**</span><span class="token number">2</span> <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">)</span>  <span class="token comment"># {1: 1, 2: 4, 3: 9, 4: 16}</span>
</code></pre> 
<ol start="2"><li>将两个列表合并为一个字典</li></ol> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;name&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;age&#39;</span><span class="token punctuation">,</span> <span class="token string">&#39;gender&#39;</span><span class="token punctuation">]</span>
list2 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token string">&#39;Tom&#39;</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token string">&#39;man&#39;</span><span class="token punctuation">]</span>

dict1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span>list1<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">:</span> list2<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>list1<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>dict1<span class="token punctuation">)</span>
</code></pre> 
<ol start="3"><li>提取字典中目标数据</li></ol> 
<pre><code class="prism language-python">counts <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token string">&#39;MBP&#39;</span><span class="token punctuation">:</span> <span class="token number">268</span><span class="token punctuation">,</span> <span class="token string">&#39;HP&#39;</span><span class="token punctuation">:</span> <span class="token number">125</span><span class="token punctuation">,</span> <span class="token string">&#39;DELL&#39;</span><span class="token punctuation">:</span> <span class="token number">201</span><span class="token punctuation">,</span> <span class="token string">&#39;Lenovo&#39;</span><span class="token punctuation">:</span> <span class="token number">199</span><span class="token punctuation">,</span> <span class="token string">&#39;acer&#39;</span><span class="token punctuation">:</span> <span class="token number">99</span><span class="token punctuation">}</span>

<span class="token comment"># 需求&#xff1a;提取上述电脑数量大于等于200的字典数据</span>
count1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span>key<span class="token punctuation">:</span> value <span class="token keyword">for</span> key<span class="token punctuation">,</span> value <span class="token keyword">in</span> counts<span class="token punctuation">.</span>items<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">if</span> value <span class="token operator">&gt;&#61;</span> <span class="token number">200</span><span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>count1<span class="token punctuation">)</span>  <span class="token comment"># {&#39;MBP&#39;: 268, &#39;DELL&#39;: 201}</span>
</code></pre> 
<h3><a id="3__2416"></a>3. 集合推导式</h3> 
<p>需求&#xff1a;创建一个集合&#xff0c;数据为下方列表的2次方。</p> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span>
</code></pre> 
<p>代码如下&#xff1a;</p> 
<pre><code class="prism language-python">list1 <span class="token operator">&#61;</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span>
set1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span>i <span class="token operator">**</span> <span class="token number">2</span> <span class="token keyword">for</span> i <span class="token keyword">in</span> list1<span class="token punctuation">}</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>set1<span class="token punctuation">)</span>  <span class="token comment"># {1, 4}</span>
</code></pre> 
<blockquote> 
 <p>注意&#xff1a;集合有数据去重功能。</p> 
</blockquote> 
<p><em><strong>补充&#xff1a;接下来的Python高级语法&#xff1a;函数、文件操作、面向对象、模块、包、异常等知识&#xff0c;我将陆续更新在自己的博客之中。如果本博文的知识能帮助到您的Python学习&#xff0c;本博主实属荣幸。更多后续知识&#xff0c;请关注博主&#xff0c;方便您第一时间查看&#xff0c;谢谢&#xff01;</strong></em></p> 
<p><img src="https://img-blog.csdnimg.cn/20200724202014569.jpg?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDM0Mzg0,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p>
                </div>
                <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/markdown_views-d7a94ec6ab.css" rel="stylesheet">
                <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/style-ba784fbaf8.css" rel="stylesheet">
        </div>
<div class="blogger-info-card">
    <div class="card-lt">
        <a href="https://luckylifes.blog.csdn.net" target="_blank">
            <img src="https://profile.csdnimg.cn/5/C/1/3_qq_44034384" username="qq_44034384" alt="">
        </a>
    </div>
    <div class="card-rt">
        <div class="card-rt-header">
            <a href="https://luckylifes.blog.csdn.net" target="_blank">
                <strong class="nick-name" username="qq_44034384">
                    不染-何程龙
                </strong>
            </a>
            <span class="wap-icon icon-two">
                <img src="https://csdnimg.cn/release/blogv2/dist/mobile/img/expertNew.png" alt="">
                <span class="bubble">CSDN认证博客专家</span>
            </span>
            <i class="space"></i>
                <span class="tag">Python</span>
                <span class="tag">Java</span>
                <span class="tag">SQL</span>
        </div>
        <div class="card-rt-body">
            何程龙，大学计算机信息管理专业在读，现就任后端开发工程师、数据库工程师。曾担任城建创新创业学院理事会会长，现为CSDN博客专家、签约讲师，中国开源协会-开发分会管理委员会委员。带过多批学员，因授课耐心细致，通俗易懂，风趣幽默，富有激情，受学员一致好评。现主要从事软件开发及软件教育培训，具有丰富的实战经验，善于将复杂问题简单化，擅长Web前端、JavaScript框架、Java并发、C#编程、Python Web、数据库SQL等领域及技术。
        </div>
    </div>
</div>
    </article>
</div>
<script>
    // 敏感词替换
    // replaceArticleContentWords(blogSensitiveWords,'sensitiveWords')
    // 高亮词
    // replaceArticleContentWords(blogHotWords,'hotWords')
    // 公共方法
    function replaceArticleContentWords(words,type){
      if(words){   
        var getContentViews = document.getElementById("content_views");
        var getContentTitle = document.getElementById("articleContentId");
        var contentViewsInnerHTML = getContentViews.innerHTML;
        var contentTitleInnerHTML = getContentTitle.innerHTML;
        var keyWordsJsonArr = [];
        var keyWordsArr = words.split(',');
        function repeatTimes(str, num){
            return num > 1 ? str += repeatTimes(str, --num): str;
        }
        for(var i = 0; i < keyWordsArr.length; i++){
            var keyWordsJson = {} ;
            keyWordsJson.key = keyWordsArr[i];
            if(type == 'hotWords'){
              keyWordsJson.value = '<span class="hot-words-highlight">'+keyWordsArr[i]+'</span>'
            }else if(type == 'sensitiveWords'){
              keyWordsJson.value = repeatTimes("*",keyWordsArr[i].length);
            }else {
              keyWordsJson.value = keyWordsArr[i]
            }
            keyWordsJsonArr.push(keyWordsJson);
        }
        var reg;
        for(var i = 0; i < keyWordsJsonArr.length; i++){
            var item = keyWordsJsonArr[i]; 
            if(type == 'hotWords'){
              reg = new RegExp(item.key,"ig");
            }
            if(type == 'sensitiveWords'){
              reg = new RegExp(item.key+"(?!([^<]*>)|([^<]*<\/a>))","ig");  
            }
            contentViewsInnerHTML = contentViewsInnerHTML.replace(reg,item.value);
            contentTitleInnerHTML = contentTitleInnerHTML.replace(reg,item.value);
        }
        getContentViews.innerHTML=contentViewsInnerHTML;
        getContentTitle.innerHTML=contentTitleInnerHTML;
      }
    }
</script>
<div class="more-toolbox" id="toolBarBox">
    <span id="fixedBar"></span>
    <div class="left-toolbox">
        <ul class="toolbox-list">
            <li class="tool-item tool-item-size tool-active is-like" id="is-like"><a>
            <img style="display:none;" id="is-like-imgactive-animation-like" class="animation-dom active-animation" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarThumbUpactive.png" alt="">
            <img class="isactive" style="display:none" id="is-like-imgactive" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarThumbUpactive.png" alt="">
            <img class="isdefault" style="display:block" id="is-like-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarThumbUp.png" alt="">   
            <span class="name" id="is-like-span">点赞</span>
            <span id="spanCount" class="count">
                    270
            </span>
            </a></li>
            <li class="tool-item tool-item-size tool-active tool-item-comment">
                <a href="#commentBox">
                    <img class="isdefault" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarComment.png" alt="">
                    <img class="isactive" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCommentactive.png" style="display:none;" alt="">
                    <span class="name">评论</span>
                    <span class="count">
                        51
                    </span>
                </a>
            </li>
            <li class="tool-item tool-item-size tool-active tool-QRcode" id="tool-share">
                <a href="javascript:;" data-report-click='{"mod":"1582594662_002","spm":"1001.2101.3001.4129","ab":"new"}'>
                    <img class="isdefault" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarShare.png" alt="">
                    <img class="isactive" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarShareactive.png" style="display:none;" alt="">
                    <span class="name">分享</span>
                </a>
                <div class="QRcode" id="tool-QRcode" style="left:-92%;">
                    <span id="QRcode-close">x</span>
                    <p class="title">
                    海报分享
                    </p>
                    <div id='shareCode'></div>
                    <p>
                    扫一扫，分享海报
                    </p>
                </div>
            </li>
            <li class="tool-item tool-item-size tool-active is-collection ">
                <a href="javascript:;" data-report-click='{"mod":"popu_824","spm":"1001.2101.3001.4130","ab":"new"}'>
                    <img style="display:none" id="is-collection-img-collection" class="animation-dom active-animation" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollectionActive.png" alt="">
                    <img class="isdefault" id="is-collection-img" style="display:block" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollect.png" alt="">
                    <img class="isactive" id="is-collection-imgactive" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollectionActive.png" alt="">
                    <span class="name" id="is-collection">收藏</span>
                    <span class="count get-collection" id="get-collection">
                        1415
                    </span>
                </a>
            </li>
            <li class="tool-item tool-item-size tool-active tool-reward">
                <a  id="toolreward" data-report-click='{"mod":"popu_830","spm":"1001.2101.3001.4237","dest":"","ab":"new"}'>
                    <img class="isdefault" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarReward.png" alt="">
                    <img class="isactive" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarRewardactive.png" style="display:none;" alt="">
                    <span class="name">打赏</span>
                </a>
<div id="reward" class="reward-box">
	<p class="rewad-title">打赏<span class="reward-close"><svg t="1567152543821" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10924" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12"><defs><style type="text/css"></style></defs><path d="M512 438.378667L806.506667 143.893333a52.032 52.032 0 1 1 73.6 73.621334L585.621333 512l294.485334 294.485333a52.074667 52.074667 0 0 1-73.6 73.642667L512 585.621333 217.514667 880.128a52.053333 52.053333 0 1 1-73.621334-73.642667L438.378667 512 143.893333 217.514667a52.053333 52.053333 0 1 1 73.621334-73.621334L512 438.378667z" fill="" p-id="10925"></path></svg></span></p>
	<dl>
		<dd>
		<a href="https://luckylifes.blog.csdn.net" data-report-click='{"mod":"popu_379","dest":"https://luckylifes.blog.csdn.net","ab":"new"}'>
			<img src="https://profile.csdnimg.cn/5/C/1/3_qq_44034384" class="avatar_pic">
		</a>
		</dd>
		<dt>
			<p class="blog-name">不染-何程龙</p>
			<p class="blog-discript">你的鼓励将是我创作的最大动力</p>
		</dt>
	</dl>
	<div class="change-bt-box">
		<span class="reward-bt reward-bt-coin">C币</span>
		<span class="reward-bt-space"></span>
		<span class="reward-bt reward-bt-money reward-bt-active">余额</span>
	</div>
	<div class="money-box">
			<span class="choose_money choosed" data-id="2">2C币</span>
			<span class="choose_money " data-id="4">4C币</span>
			<span class="choose_money " data-id="6">6C币</span>
			<span class="choose_money " data-id="10">10C币</span>
			<span class="choose_money " data-id="20">20C币</span>
			<span class="choose_money " data-id="50">50C币</span>
	</div>
	<div class="sure-box">
		<p class="is-have-money"><a class="reward-sure">确定</a></p>
	</div>
</div>
            </li>
            <li class="tool-item tool-item-size tool-active tool-more">
              <a class="article-report">
                <img class="isdefault" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarReport.png" alt="">
                <img class="isactive" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarReportactive.png" style="display:none;" alt="">
                <span class="name">举报</span>
              </a>
            </li>
            <li class="tool-item">
                    <a class="tool-attend tool-bt-button tool-bt-attend" href="javascript:;" data-report-view='{"mod":"1592215036_002","spm":"1001.2101.3001.4232","extend1":"关注"}'>关注</a>
                <a class="tool-item-follow active-animation" style="display:none;">关注</a>
            </li>
            <li class="tool-item">
                    <p class="company active" id="health-companies" href="javascript:;" >一键三连</p>
                <span class="triplet-prompt">点赞Mark关注该博主, 随时了解TA的最新博文<img class="close-prompt" src="https://csdnimg.cn/release/blogv2/dist/pc/img/closePrompt.png"></span>
            </li>
        </ul>
        <div style="display:flex">
         </div>
         <div class="hot-word-tip-box">
          <span class="hot-word-text">已标记关键词</span>
          <span class="hot-word-count"></span> 
          <span class="hot-word-bar"></span>
          <span class="hot-word-clear">清除标记</span>
        </div>
    </div>  
</div>
<script type=text/javascript crossorigin src="https://csdnimg.cn/release/phoenix/production/qrcode-7c90a92189.min.js"></script>
<script src="//g.csdnimg.cn/??sharewx/1.2.1/sharewx.js" type="text/javascript"></script>
<script type="text/javascript" crossorigin src="https://g.csdnimg.cn/collection-box/2.0.3/collection-box.js"></script>
                <div class="first-recommend-box recommend-box">
<div class="recommend-item-box type_other clearfix" data-url="https://edu.csdn.net/topic/java2"  data-report-view='{"ab":"new","mod":"popu_871","extra":"{\"utm_medium\":\"distribute.pc_relevant_t0.477466\"}","index":"1","strategy":"32_477466_RCMD","dest":"https://edu.csdn.net/topic/java2"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://edu.csdn.net/topic/java2" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_871","extra":"{\"utm_medium\":\"distribute.pc_relevant_t0.477466\"}","index":"1","strategy":"32_477466_RCMD","dest":"https://edu.csdn.net/topic/java2"}'  data-report-query='utm_medium=distribute.pc_relevant_t0.477466&depth_1-utm_source=distribute.pc_relevant_t0.477466'>
					Java程序员&ldquo;黄金五年&rdquo;：如何实现月薪一万五到年薪50万的转变？
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info display-flex">
					<span class="info-block">12-28</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://edu.csdn.net/topic/java2" target="_blank"  data-report-click='{"ab":"new","mod":"popu_871","extra":"{\"utm_medium\":\"distribute.pc_relevant_t0.477466\"}","index":"1","strategy":"32_477466_RCMD","dest":"https://edu.csdn.net/topic/java2"}'  data-report-query='utm_medium=distribute.pc_relevant_t0.477466&depth_1-utm_source=distribute.pc_relevant_t0.477466'>
				<div class="desc ellipsis-online ellipsis-online-1">&ldquo;黄金五年&rdquo; 是Java程序界流行的说法，即是说一个程序员从入职的时候算起，前五年的选择和成长直接影响着整个职业生涯中的职业发展方向和薪资走向。对于程序员来说，要客观认识自身的情况，想清楚自己现在要什么、未来要什么，做好职业规划才有利于自己的晋升之路。</div>
			</a>
		</div>
	</div>
</div>
                </div>
            <div class="second-recommend-box recommend-box">
<div class="recommend-item-box type_course clearfix" data-url="https://edu.csdn.net/course/detail/8788"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-course-OPENSEARCH-1.not_use_machine_learn_pai\"}","index":"1","strategy":"OPENSEARCH","dest":"https://edu.csdn.net/course/detail/8788"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://edu.csdn.net/course/detail/8788" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-course-OPENSEARCH-1.not_use_machine_learn_pai\"}","index":"1","strategy":"OPENSEARCH","dest":"https://edu.csdn.net/course/detail/8788"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-course-OPENSEARCH-1.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-course-OPENSEARCH-1.not_use_machine_learn_pai'>
					爬虫微课5小时 <em>Python</em>学习路线
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info display-flex">
					<span class="info-block">07-10</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://edu.csdn.net/course/detail/8788" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-course-OPENSEARCH-1.not_use_machine_learn_pai\"}","index":"1","strategy":"OPENSEARCH","dest":"https://edu.csdn.net/course/detail/8788"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-course-OPENSEARCH-1.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-course-OPENSEARCH-1.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1"><em>Python</em>爬虫技术视频教程，该课程每堂课都有一个作业，包含的项目案例有家长帮142600条数据爬取与分析，全球天气数据抓取与分析，淘宝商品信息数据众数分析，12306余票查询，<em>python</em>软件打包exe与发布。学完此课程能让你对整个数据爬取数据分析有一个全新的了解，适当的深入则可以做这方面的工作</div>
			</a>
		</div>
	</div>
</div>
            </div>
<a id="commentBox" name="commentBox"></a>
<div class="comment-box">
	<div class="comment-edit-box d-flex">
		<a id="commentsedit"></a>
		<div class="user-img">
			<a href="javascript:void(0);" >
				<img class="show_loginbox" src="https://g.csdnimg.cn/static/user-img/anonymous-User-img.png">
			</a>
		</div>
		<form id="commentform">
			<img class="comment-sofa-flag" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentFlag@2x.png">
      <textarea class="comment-content" name="comment_content" id="comment_content" placeholder="优质评论可以帮助作者获得更高权重" maxlength="1000"></textarea>
			<div class="comment-emoticon"><img class="comment-emoticon-img" data-url="https://csdnimg.cn/release/blogv2/dist/pc/img/" src="https://csdnimg.cn/release/blogv2/dist/pc/img/emoticon.png" alt="表情包"></div> 
      <span class="comment-emoticon-tip">插入表情</span>
      <div class="comment-emoticon-box">
        <div class="comment-emoticon-img-box">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:001.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/001.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:002.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/002.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:003.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/003.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:004.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/004.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:005.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/005.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:006.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/006.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:007.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/007.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:008.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/008.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:009.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/009.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:010.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/010.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:011.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/011.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:012.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/012.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:013.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/013.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:014.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/014.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:015.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/015.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:016.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/016.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:017.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/017.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:018.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/018.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:019.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/019.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:020.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/020.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:021.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/021.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:022.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/022.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:023.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/023.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:024.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/024.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:025.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/025.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:026.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/026.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:027.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/027.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:028.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/028.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:029.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/029.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:030.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/030.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:031.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/031.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:032.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/032.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:033.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/033.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:034.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/034.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:035.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/035.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:036.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/036.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:037.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/037.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:038.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/038.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:039.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/039.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:040.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/040.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:041.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/041.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:042.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/042.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:043.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/043.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:044.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/044.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:045.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/045.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:046.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/046.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:047.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/047.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:048.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/048.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:049.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/049.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:050.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/050.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:051.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/051.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:052.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/052.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:053.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/053.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:054.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/054.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:055.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/055.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:056.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/056.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:057.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/057.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:058.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/058.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:059.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/059.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:060.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/060.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:061.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/061.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:062.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/062.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:063.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/063.png">
            <img class="emoticon-monkey-img" data-emoticon="[face]monkey2:064.png[/face]" src="https://g.csdnimg.cn/static/face/monkey2/064.png">
        </div>
      </div>
      <div class="opt-box">
				<div id="ubbtools" class="add_code">
					<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
				</div>
				<input type="hidden" id="comment_replyId" name="comment_replyId">
				<input type="hidden" id="article_id" name="article_id" value="107044216">
				<input type="hidden" id="comment_userId" name="comment_userId" value="">
				<input type="hidden" id="commentId" name="commentId" value="">
				<div class="dropdown" id="myDrap">
					<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button"
						aria-haspopup="true" aria-expanded="false">
						<div class="txt-selected text-truncate">添加代码片</div>
						<svg class="icon d-block" width="200px" height="100.00px" viewBox="0 0 2048 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path  d="M597.33333292 298.666667h853.333334L1023.99999992 725.333333 597.33333292 298.666667z"  /></svg>
					</a>
					<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
						<li><a data-code="html">HTML/XML</a></li>
						<li><a data-code="objc">objective-c</a></li>
						<li><a data-code="ruby">Ruby</a></li>
						<li><a data-code="php">PHP</a></li>
						<li><a data-code="csharp">C</a></li>
						<li><a data-code="cpp">C++</a></li>
						<li><a data-code="javascript">JavaScript</a></li>
						<li><a data-code="python">Python</a></li>
						<li><a data-code="java">Java</a></li>
						<li><a data-code="css">CSS</a></li>
						<li><a data-code="sql">SQL</a></li>
						<li><a data-code="plain">其它</a></li>
					</ul>
				</div>
				<div class="right-box" id="rightBox" data-type="2">
							<span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
							<a data-report-view='{"spm":"3001.4374"}' data-report-click='{"spm":"3001.4374"}' class="btn btn-sm btn-quick-comment" id="quickComment">“速评一下”</a>
							<a data-report-click='{"mod":"1582594662_003","spm":"1001.2101.3001.4227","ab":"new"}'><input type="submit"
									class="btn btn-sm btn-comment" value="发表评论"></a>
				</div>
			</div>
		</form>
		<input type="button" class="bt-comment-show" value="评论">
	</div>
	<div class="comment-list-container">
		<a id="comments"></a>
		<div class="comment-list-box">
		</div>
		<div id="commentPage" class="pagination-box d-none"></div>
		<div class="opt-box text-center">
			<div class="btn btn-sm btn-link-blue" id="btnMoreComment"></div>
		</div>
	</div>
</div>            <div class="recommend-box insert-baidu-box">

<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/yilovexing/article/details/80577510"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai\"}","index":"2","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/yilovexing/article/details/80577510"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/yilovexing/article/details/80577510" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai\"}","index":"2","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/yilovexing/article/details/80577510"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai'>
					<em>Python</em>3 * 和 ** 运算符
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/yilovexing" target="_blank"><span class="blog-title">极客点儿</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-05</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					26万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/yilovexing/article/details/80577510" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai\"}","index":"2","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/yilovexing/article/details/80577510"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1">在 <em>Python</em> 中，* 和 ** 具有<em>语法</em>多义性，具体来说是有三类用法。1. 算数运算* &nbsp;代表乘法** 代表乘方&amp;gt;&amp;gt;&amp;gt; 2 * 5
10
&amp;gt;&amp;gt;&amp;gt; 2 ** 5
322. 函数参数*args 和 **kwargs 主要用于函数定义。你可以将不定数量的参数传递给一个函数。不定的意思是：预先并不知道, 函数使用者会传递多少个参数给你, 所以在这个场景下使用这两个关...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://sunlogging.blog.csdn.net/article/details/48664887"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai\"}","index":"3","strategy":"BlogCommendFromBaidu","dest":"https://sunlogging.blog.csdn.net/article/details/48664887"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://sunlogging.blog.csdn.net/article/details/48664887" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai\"}","index":"3","strategy":"BlogCommendFromBaidu","dest":"https://sunlogging.blog.csdn.net/article/details/48664887"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai'>
					带你玩转Visual Studio&mdash;&mdash;开篇介绍
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/luoweifu" target="_blank"><span class="blog-title">阳光日志</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">09-22</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					4万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://sunlogging.blog.csdn.net/article/details/48664887" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai\"}","index":"3","strategy":"BlogCommendFromBaidu","dest":"https://sunlogging.blog.csdn.net/article/details/48664887"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1">开篇之前，先唠叨几句本人从事C++开发工作一年半，总想就C++开发方面写点东西。写什么呢？想了一下还是写点跟开发密切相关的吧，要说跟开发最密切相关的那莫过于就是开发工具了，也就是常常说的集成开发环境(IDE)。 这一年多从事的是C++的跨平台开发，在Linux和Windows下都开发过，但主要还是在Windows下进行开发(一般会在Windows下开发，多个平台下编译)，因为Windows下有强大好</div>
			</a>
		</div>
	</div>
</div>
		<div id="recommend-item-box-tow" class="recommend-item-box type_blog clearfix">
			<div id="kp_box_59" data-pid="59"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="fluid"
     data-ad-layout-key="-hk-b+1w-4q+5k"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="3967051353"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=59&a=944&c=0&k=&spm=1001.2101.3001.5003&d=1&t=3&u=a29519eb399140e9ad53b8e5a354af41" style="display: block;width: 0px;height: 0px;"></div>
		</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://y1ran.blog.csdn.net/article/details/80855086"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-4.not_use_machine_learn_pai\"}","index":"4","strategy":"OPENSEARCH","dest":"https://y1ran.blog.csdn.net/article/details/80855086"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://y1ran.blog.csdn.net/article/details/80855086" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-4.not_use_machine_learn_pai\"}","index":"4","strategy":"OPENSEARCH","dest":"https://y1ran.blog.csdn.net/article/details/80855086"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-4.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-4.not_use_machine_learn_pai'>
					<em>Python</em>2和<em>Python</em>3的区别，以及为什么选<em>Python</em>3的原因
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/qq_39521554" target="_blank"><span class="blog-title">Machine Learning with Turing&#39;s Cat</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-29</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					13万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://y1ran.blog.csdn.net/article/details/80855086" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-4.not_use_machine_learn_pai\"}","index":"4","strategy":"OPENSEARCH","dest":"https://y1ran.blog.csdn.net/article/details/80855086"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-4.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-4.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1">我的机器学习教程「美团」算法工程师带你入门机器学习 已经开始更新了，欢迎大家订阅~

任何关于算法、编程、AI行业知识或博客内容的问题，可以随时扫码关注公众号「图灵的猫」，加入&rdquo;学习小组&ldquo;，沙雕博主在线答疑~此外，公众号内还有更多AI、算法、编程和大数据知识分享，以及免费的SSR节点和学习资料。其他平台（知乎/B站）也是同名「图灵的猫」，不要迷路哦~















学...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/weixin_34242509/article/details/86324870"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-5.not_use_machine_learn_pai\"}","index":"5","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/weixin_34242509/article/details/86324870"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/weixin_34242509/article/details/86324870" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-5.not_use_machine_learn_pai\"}","index":"5","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/weixin_34242509/article/details/86324870"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-5.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-5.not_use_machine_learn_pai'>
					atitit.短信&nbsp;验证码&nbsp;&nbsp;破解&nbsp;&nbsp;v3&nbsp;p34&nbsp;&nbsp;识别&nbsp;绕过&nbsp;系统方案规划----业务相关方案&nbsp;手机验证码&nbsp;&nbsp;.doc...
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/weixin_34242509" target="_blank"><span class="blog-title">weixin_34242509的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">03-09</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					3578
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/weixin_34242509/article/details/86324870" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-5.not_use_machine_learn_pai\"}","index":"5","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/weixin_34242509/article/details/86324870"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-5.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-5.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1">


&nbsp;atitit.短信&nbsp;验证码&nbsp;&nbsp;破解&nbsp;&nbsp;v3&nbsp;p34&nbsp;&nbsp;识别&nbsp;绕过&nbsp;系统方案规划----业务相关方案&nbsp;手机验证码&nbsp;&nbsp;.doc
&nbsp;
&nbsp;
&nbsp;
1.&nbsp;手机短信验证码&nbsp;vs&nbsp;图片验证码&nbsp;安全性（破解成本）确实要高一些1
1.1.&nbsp;破解基本原则有两种，一种是绕过验证码。一种是拦截1
2.&nbsp;手机&nbsp;短信&nbsp;验证码的&nbsp;破解&nbsp;拦截&nbsp;方式分类2
2.1.&nbsp;按照源头破解拦截分为源头拦截，中间拦截，，终端拦截。。。2...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://guoxiaodong.blog.csdn.net/article/details/9045861"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6.not_use_machine_learn_pai\"}","index":"6","strategy":"BlogCommendFromBaidu","dest":"https://guoxiaodong.blog.csdn.net/article/details/9045861"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://guoxiaodong.blog.csdn.net/article/details/9045861" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6.not_use_machine_learn_pai\"}","index":"6","strategy":"BlogCommendFromBaidu","dest":"https://guoxiaodong.blog.csdn.net/article/details/9045861"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6.not_use_machine_learn_pai'>
					Unicdoe【真正的完整码表】对照表（二）汉字Unicode表
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/hherima" target="_blank"><span class="blog-title">郭晓东的专栏</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-07</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					36万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://guoxiaodong.blog.csdn.net/article/details/9045861" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6.not_use_machine_learn_pai\"}","index":"6","strategy":"BlogCommendFromBaidu","dest":"https://guoxiaodong.blog.csdn.net/article/details/9045861"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1">注意：下面这两段是代理区。即第1&mdash;&mdash;16平面的间接表示，四个字节的汉字就在这里表示
D800-DBFF：High-half zone of UTF-16      
DC00-DFFF：Low-half zone of UTF-16 
本篇中包含了所有常用汉字27973个，剩余汉字使用代理区标识

欢迎查看字符编码相关博客专栏
比如：由iPhone emoji问题牵出的UTF-16编码，UTF-8编码探究</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/Dexter_Wang/article/details/72901746"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-7.not_use_machine_learn_pai\"}","index":"7","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/Dexter_Wang/article/details/72901746"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/Dexter_Wang/article/details/72901746" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-7.not_use_machine_learn_pai\"}","index":"7","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/Dexter_Wang/article/details/72901746"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-7.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-7.not_use_machine_learn_pai'>
					企业级rsync同步：sersync多目录实时步操作记录
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/Dexter_Wang" target="_blank"><span class="blog-title">Dexter_Wang的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-07</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					4582
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/Dexter_Wang/article/details/72901746" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-7.not_use_machine_learn_pai\"}","index":"7","strategy":"BlogCommendFromBaidu","dest":"https://blog.csdn.net/Dexter_Wang/article/details/72901746"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-7.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-7.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1">sersync多目录实时步操作记录


一.环境描述
&nbsp;测试环境
需求：服务器A与服务器B为主备服务模式，需要保持文件一致性，现采用sersync基于rsync+inotify实现数据实时同步
&nbsp;
环境描述：&nbsp;
主服务器222.173.188.43 &nbsp; &nbsp; &nbsp; &nbsp;从服务器：119.36.192.44
&nbsp;
二.实施方法
1.从服务器119.36.192.44 rsync服务搭建</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/lmseo5hy/article/details/81704426"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-8.not_use_machine_learn_pai\"}","index":"8","strategy":"OPENSEARCH","dest":"https://blog.csdn.net/lmseo5hy/article/details/81704426"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/lmseo5hy/article/details/81704426" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-8.not_use_machine_learn_pai\"}","index":"8","strategy":"OPENSEARCH","dest":"https://blog.csdn.net/lmseo5hy/article/details/81704426"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-8.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-8.not_use_machine_learn_pai'>
					<em>Python</em>定义全局变量的用法
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/lmseo5hy" target="_blank"><span class="blog-title">lmseo5hy的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">08-15</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					16万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/lmseo5hy/article/details/81704426" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-8.not_use_machine_learn_pai\"}","index":"8","strategy":"OPENSEARCH","dest":"https://blog.csdn.net/lmseo5hy/article/details/81704426"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-8.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-8.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1">全局变量是编程语言中常见的一种变量，通过全局定义，可以是某对象函数创建，也可以是本程序任何位置创建，能够被本程序中的所有对象或函数进行引用，全局变量的定义有利于程序的变量共享，简化了添加和修改的程序。

和C语言一样，<em>Python</em>也具有全局变量，其定义全局变量的用法有两种：

1. 声明法

该方法是直接在当前模块中进行全局变量定义声明，使用global的声明方式，再进行引用！


OLD_URL...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/qq_25814003/article/details/80609729"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-9.not_use_machine_learn_pai\"}","index":"9","strategy":"OPENSEARCH","dest":"https://blog.csdn.net/qq_25814003/article/details/80609729"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/qq_25814003/article/details/80609729" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-9.not_use_machine_learn_pai\"}","index":"9","strategy":"OPENSEARCH","dest":"https://blog.csdn.net/qq_25814003/article/details/80609729"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-9.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-9.not_use_machine_learn_pai'>
					<em>python</em>安装教程
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/qq_25814003" target="_blank"><span class="blog-title">愤怒的懒洋洋的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-07</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					23万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/qq_25814003/article/details/80609729" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-9.not_use_machine_learn_pai\"}","index":"9","strategy":"OPENSEARCH","dest":"https://blog.csdn.net/qq_25814003/article/details/80609729"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-9.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-9.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1"><em>Python</em>安装教程一、博主自言随着人工智能的快速发展，<em>python</em>语言越来越受大家的欢迎，博主前段时间先自学了一次，这次再次巩固，顺便分享给大家我遇到的坑。帮助大家学习的时候少走弯路。希望会对大家有所帮助，欢迎留言提问。PS文章底部是我的<em>python</em>3.7包下载链接，大家可以自行下载。&nbsp;二、安装环境&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 本套教程的安装环境是：win7 或者win10系统&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em>Python</em>版本：p...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://dream.blog.csdn.net/article/details/86106916"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-10.not_use_machine_learn_pai\"}","index":"10","strategy":"OPENSEARCH","dest":"https://dream.blog.csdn.net/article/details/86106916"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://dream.blog.csdn.net/article/details/86106916" class="tit ellipsis-online ellipsis-online-1" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-10.not_use_machine_learn_pai\"}","index":"10","strategy":"OPENSEARCH","dest":"https://dream.blog.csdn.net/article/details/86106916"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-10.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-10.not_use_machine_learn_pai'>
					<em>Python</em>爬虫100例教程导航帖（已完结）
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/hihell" target="_blank"><span class="blog-title">Python爬虫百例、Python面试百题、Pandas趣味深入学习</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">08-14</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					3万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://dream.blog.csdn.net/article/details/86106916" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-OPENSEARCH-10.not_use_machine_learn_pai\"}","index":"10","strategy":"OPENSEARCH","dest":"https://dream.blog.csdn.net/article/details/86106916"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-10.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-10.not_use_machine_learn_pai'>
				<div class="desc ellipsis-online ellipsis-online-1"><em>Python</em>爬虫入门教程导航，目标100篇。

本系列博客争取把爬虫入门阶段的所有内容都包含住，需要你有较好的<em>Python</em><em>基础</em>知识，当然你完全零<em>基础</em>也可以观看本系列博客。

<em>Python</em>爬虫入门教程，加油！

</div>
			</a>
		</div>
	</div>
</div>
            </div>
            <div class="template-box">
                <span>©️2020 CSDN</span>
                <span>皮肤主题: 成长之路</span>
                <span> 设计师:Amelia_0503</span>
                <span>
                    <a href="https://blog.csdn.net/" class="back-home c-blue c-blue-hover c-blue-focus">返回首页</a>
                </span>
            </div>
<div class="blog-footer-bottom" style="margin-top:10px;"></div>
<script src="https://g.csdnimg.cn/common/csdn-footer/csdn-footer.js" data-isfootertrack="false" type="text/javascript"></script>
<script type="text/javascript">
    window.csdn.csdnFooter.options = {
        el: '.blog-footer-bottom',
        type: 2
    }
</script>        </main>
<aside class="blog_container_aside">
    <div id="asideProfile" class="aside-box">
    <div class="profile-intro d-flex">
        <div class="avatar-box d-flex justify-content-center flex-column">
            <a href="https://luckylifes.blog.csdn.net" data-report-click='{"mod":"popu_379","spm":"1001.2101.3001.4121","dest":"https://luckylifes.blog.csdn.net","ab":"new"}'>
                <img src="https://profile.csdnimg.cn/5/C/1/3_qq_44034384" class="avatar_pic">
            </a>
        </div>
        <div class="user-info d-flex flex-column profile-intro-name-box">
            <div class="profile-intro-name-boxTop">
                <a href="https://luckylifes.blog.csdn.net" class="" id="uid" title="不染-何程龙" data-report-click='{"mod":"popu_379","spm":"1001.2101.3001.4122","dest":"https://luckylifes.blog.csdn.net","ab":"new"}'>
                    <span class="name " username="qq_44034384">不染-何程龙</span>
                </a>
                <span>
                </span>
                <span class="flag expert-blog">
                <img class="identity" src="https://csdnimg.cn/release/blogv2/dist/mobile/img/expertNew.png" alt="">
                <span class="bubble">CSDN认证博客专家</span>
                </span>
                <span class="flag company-blog">
                <span class="bubble">CSDN认证企业博客</span>
                </span>
            </div>
            <div class="profile-intro-name-boxFooter">
                <span class="personal-home-page personal-home-years">码龄2年</span>
                    <span class="personal-home-page">
                    <a class="personal-home-certification" href="https://i.csdn.net/#/uc/profile?utm_source=14998968" target="_blank" title="西安英莱特信息科技有限公司">
                    <img src="https://csdnimg.cn/identity/enstaf.png" alt="">
                    西安英莱特信息科技有限公司
                    </a>
                    </span>
            </div>
        </div>
    </div>
    <div class="data-info d-flex item-tiling">
        <dl class="text-center" title="337">
            <a href="https://luckylifes.blog.csdn.net" data-report-click='{"mod":"1598321000_001","spm":"1001.2101.3001.4310"}' data-report-query="t=1">  
                <dt><span class="count">337</span></dt>
                <dd class="font">原创</dd>
            </a>
        </dl>
        <dl class="text-center" data-report-click='{"mod":"1598321000_002","spm":"1001.2101.3001.4311"}' title="874">
            <a href="https://blog.csdn.net/rank/writing_rank" target="_blank">
                <dt><span class="count">874</span></dt>
                <dd class="font">周排名</dd>
            </a>
        </dl>
        <dl class="text-center" title="9165">
            <a href="https://blog.csdn.net/rank/writing_rank_total" data-report-click='{"mod":"1598321000_003","spm":"1001.2101.3001.4312"}' target="_blank">
                <dt><span class="count">9165</span></dt>
                <dd class="font">总排名</dd>
            </a>
        </dl>
        <dl class="text-center" style="min-width:58px" title="258107">  
            <dt><span class="count">25万+</span></dt>
            <dd>访问</dd>
        </dl>
        <dl class="text-center" title="6级,点击查看等级说明">
            <dt><a href="https://blog.csdn.net/home/help.html#level" target="_blank">
                <img class="level" src="https://csdnimg.cn/identity/blog6.png">
            </a>
            </dt>
            <dd>等级</dd>
        </dl>
    </div>
    <div class="item-rank"></div>
    <div class="data-info d-flex item-tiling">
        <dl class="text-center" title="6022">
            <dt><span class="count">6022</span></dt>
            <dd>积分</dd>
        </dl>
         <dl class="text-center" id="fanBox" title="741">
            <dt><span class="count" id="fan">741</span></dt>
            <dd>粉丝</dd>
        </dl>
        <dl class="text-center" title="569">
            <dt><span class="count">569</span></dt>
            <dd>获赞</dd>
        </dl>
        <dl class="text-center" title="125">
            <dt><span class="count">125</span></dt>
            <dd>评论</dd>
        </dl>
        <dl class="text-center" title="2517">
            <dt><span class="count">2517</span></dt>
            <dd>收藏</dd>
        </dl>
    </div>
    <div class="aside-box-footer" data-report-view='{"spm":"3001.4296"}'>
        <div class="badge-box d-flex">
            <div class="badge d-flex">
                <div class="icon-badge" title="GitHub">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/github@240.png" alt="GitHub">
                    </div>
                </div>
                <div class="icon-badge" title="签到王者">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/qiandao300@240.png" alt="签到王者">
                    </div>
                </div>
                <div class="icon-badge" title="技术圈认证">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/blog_normal_medal@240.png" alt="技术圈认证">
                    </div>
                </div>
                <div class="icon-badge" title="持之以恒">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/chizhiyiheng@240.png" alt="持之以恒">
                    </div>
                </div>
                <div class="icon-badge" title="勤写标兵Lv4">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/qixiebiaobing4@240.png" alt="勤写标兵Lv4">
                    </div>
                </div>
                <div class="icon-badge" title="原力探索">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/yuanli_tansuo@240.png" alt="原力探索">
                    </div>
                </div>
                <div class="icon-badge" title="学习力">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/yuanli_xuexili@240.png" alt="学习力">
                    </div>
                </div>
                <div class="icon-badge" title="原力新人">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/yuanli_xinren@240.png" alt="原力新人">
                    </div>
                </div>
                <div class="icon-badge" title="原力探索 · S">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/yuanli_tansuoS@240.png" alt="原力探索 · S">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="profile-intro-name-boxOpration">
        <div class="opt-letter-watch-box">
        <a class="bt-button personal-letter" href="https://im.csdn.net/chat/qq_44034384" target="_blank" rel="noopener">私信</a>
        </div>
        <div class="opt-letter-watch-box"> 
            <a class="personal-watch bt-button" id="btnAttent" >关注</a>  
        </div>
    </div>
</div>
<div id="asideSearchArticle" class="aside-box">
	<div class="aside-content search-comter">
    <div class="aside-search aside-search-blog">         
        <input type="text" class="input-serch-blog" name="" autocomplete="off" value="" id="search-blog-words" placeholder="搜博主文章">
        <a class="btn-search-blog">
                    <img src="//csdnimg.cn/cdn/content-toolbar/csdn-sou.png?v=1587021042">
        </a>
    </div>
    </div>
</div>

<div id="asideCustom" class="aside-box custom-box">
    <h3 class="aside-title">关于博主</h3>
    <div class="aside-content clearfix">
        何程龙&#xff0c;大学计算机信息管理专业在读&#xff0c;现就任后端开发工程师、数据库工程师。曾担任城建创新创业学院理事会会长&#xff0c;现为CSDN博客专家、签约讲师&#xff0c;中国开源协会-开发分会管理委员会委员。带过多批学员&#xff0c;因授课耐心细致&#xff0c;通俗易懂&#xff0c;风趣幽默&#xff0c;富有激情&#xff0c;受学员一致好评。 现主要从事软件开发及软件教育培训&#xff0c;具有丰富的实战经验&#xff0c;善于将复杂问题简单化&#xff0c;擅长Web前端、JavaScript框架、Java并发、C#编程、Python Web、数据库SQL等领域及技术。
    </div>
</div>    

<div id="asideHotArticle" class="aside-box">
	<h3 class="aside-title">热门文章</h3>
	<div class="aside-content">
		<ul class="hotArticle-list">
			<li>
				<a href="https://luckylifes.blog.csdn.net/article/details/89881404" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://luckylifes.blog.csdn.net/article/details/89881404","ab":"new"}'>
				网站出现500显示错误解决方法，你要的都在这里！
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">25344</span>
                </a>
			</li>
			<li>
				<a href="https://luckylifes.blog.csdn.net/article/details/107044216" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://luckylifes.blog.csdn.net/article/details/107044216","ab":"new"}'>
				深入浅出Python——Python基础语法全解
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">22080</span>
                </a>
			</li>
			<li>
				<a href="https://luckylifes.blog.csdn.net/article/details/99290078" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://luckylifes.blog.csdn.net/article/details/99290078","ab":"new"}'>
				JavaScript forEach()的用法
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">16286</span>
                </a>
			</li>
			<li>
				<a href="https://luckylifes.blog.csdn.net/article/details/89890168" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://luckylifes.blog.csdn.net/article/details/89890168","ab":"new"}'>
				Win10如何配置数据源ODBC数据源
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">15340</span>
                </a>
			</li>
			<li>
				<a href="https://luckylifes.blog.csdn.net/article/details/93554395" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://luckylifes.blog.csdn.net/article/details/93554395","ab":"new"}'>
				JavaScript getElementsByName()方法介绍
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">8501</span>
                </a>
			</li>
		</ul>
	</div>
</div>
<div id="asideCategory" class="aside-box flexible-box" style="">
    <h3 class="aside-title">分类专栏</h3>
    <div class="aside-content">
        <ul>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10189881.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10189881.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Python</span>
                    </span>
                    <span class="count float-right">54篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9539448.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9539448.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20190927151132530.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">WinForm</span>
                    </span>
                    <span class="count float-right">20篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9788368.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9788368.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Java</span>
                    </span>
                    <span class="count float-right">13篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10062302.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10062302.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">C#</span>
                    </span>
                    <span class="count float-right">51篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9450939.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9450939.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20190927151117521.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">SQL Server</span>
                    </span>
                    <span class="count float-right">19篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10266468.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10266468.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Linux</span>
                    </span>
                    <span class="count float-right">1篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9994006.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9994006.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">WPF</span>
                    </span>
                    <span class="count float-right">15篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10000971.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10000971.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/2019092715111047.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">软件安装</span>
                    </span>
                    <span class="count float-right">1篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9994158.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9994158.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">MySQL</span>
                    </span>
                    <span class="count float-right">4篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8573218.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8573218.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">HTML</span>
                    </span>
                    <span class="count float-right">8篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8839213.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8839213.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Css</span>
                    </span>
                    <span class="count float-right">13篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8960937.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8960937.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">JavaScript</span>
                    </span>
                    <span class="count float-right">93篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9033018.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9033018.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">jQuery</span>
                    </span>
                    <span class="count float-right">7篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9221588.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9221588.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Node</span>
                    </span>
                    <span class="count float-right">22篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9173916.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9173916.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Ajax</span>
                    </span>
                    <span class="count float-right">6篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9173926.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9173926.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">PHP</span>
                    </span>
                    <span class="count float-right">5篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9065151.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9065151.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">案例</span>
                    </span>
                    <span class="count float-right">31篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8923050.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8923050.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">数据库</span>
                    </span>
                    <span class="count float-right">9篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9131409.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9131409.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">游戏开发</span>
                    </span>
                    <span class="count float-right">2篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8970492.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8970492.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">随笔杂文</span>
                    </span>
                    <span class="count float-right">2篇</span>
                </a>
            </li>
        </ul>
    </div>
    <p class="text-center">
        <a class="flexible-btn" data-fbox="aside-archive"><img class="look-more" src="https://csdnimg.cn/release/blogv2/dist/pc/img/arrowDownWhite.png" alt=""></a>
    </p>
</div>
<div id="asideNewComments" class="aside-box">
    <h3 class="aside-title">最新评论</h3>
    <div class="aside-content">
        <ul class="newcomment-list">
            <li>
                <a class="title text-truncate" target="_blank" href="https://luckylifes.blog.csdn.net/article/details/107044216#comments_14259656" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107044216#comments_14259656","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107044216#comments_14259656","ab":"new"}'>深入浅出Python&mdash;&mdash;Python基础语法全解</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/wjw1996718" class="user-name" target="_blank">程序员涵涵: </a>
                    <span class="code-comments">写的很好，一起加油啊！喜欢python ，对python感兴趣的朋友可以加python交流群：1075110200</span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://luckylifes.blog.csdn.net/article/details/107591175#comments_14187441" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107591175#comments_14187441","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107591175#comments_14187441","ab":"new"}'>深入浅出Python&mdash;&mdash;Python高级语法之函数</a>
                <p class="comment ellipsis">
                    <a href="https://luckylifes.blog.csdn.net" class="user-name" target="_blank">不染-何程龙: </a>
                    <span class="code-comments">谢谢支持，也祝你考试一切顺利<img src="https://g.csdnimg.cn/static/face/monkey2/002.png" alt='表情包' ></span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://luckylifes.blog.csdn.net/article/details/107591175#comments_14183112" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107591175#comments_14183112","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107591175#comments_14183112","ab":"new"}'>深入浅出Python&mdash;&mdash;Python高级语法之函数</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/weixin_52566768" class="user-name" target="_blank">瑶喋喋: </a>
                    <span class="code-comments">下周考试了，感觉帮助挺大的，一直都学不明白python<img src="https://g.csdnimg.cn/static/face/monkey2/019.png" alt='表情包' ><img src="https://g.csdnimg.cn/static/face/monkey2/019.png" alt='表情包' ><img src="https://g.csdnimg.cn/static/face/monkey2/019.png" alt='表情包' ></span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://luckylifes.blog.csdn.net/article/details/107044216#comments_14127335" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107044216#comments_14127335","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/107044216#comments_14127335","ab":"new"}'>深入浅出Python&mdash;&mdash;Python基础语法全解</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/m0_47816936" class="user-name" target="_blank">～吾皇: </a>
                    <span class="code-comments">哦哦，懂了，谢谢！</span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://luckylifes.blog.csdn.net/article/details/90420688#comments_14115624" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/90420688#comments_14115624","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://luckylifes.blog.csdn.net/article/details/90420688#comments_14115624","ab":"new"}'>案例：jQuery 如何实现图片轮播效果</a>
                <p class="comment ellipsis">
                    <a href="https://luckylifes.blog.csdn.net" class="user-name" target="_blank">不染-何程龙: </a>
                    <span class="code-comments">谢谢支持。</span>
                </p>
            </li>
        </ul>
    </div>
</div>
<div id="asideArchive" class="aside-box">
    <h3 class="aside-title">最新文章</h3>
    <div class="aside-content">
        <ul class="inf_list clearfix">
            <li class="clearfix">
            <a href="https://luckylifes.blog.csdn.net/article/details/109601068" target="_blank" data-report-click='{"mod":"popu_382","spm":"1001.2101.3001.4136","dest":"https://luckylifes.blog.csdn.net/article/details/109601068","ab":"new"}' data-report-view='{"mod":"popu_382","dest":"https://luckylifes.blog.csdn.net/article/details/109601068","ab":"new"}'>JavaScript中的模板字符串</a>
            </li>
            <li class="clearfix">
            <a href="https://luckylifes.blog.csdn.net/article/details/109600493" target="_blank" data-report-click='{"mod":"popu_382","spm":"1001.2101.3001.4136","dest":"https://luckylifes.blog.csdn.net/article/details/109600493","ab":"new"}' data-report-view='{"mod":"popu_382","dest":"https://luckylifes.blog.csdn.net/article/details/109600493","ab":"new"}'>最新的ECMAScript标准定义了8种数据类型，你知道吗？</a>
            </li>
            <li class="clearfix">
            <a href="https://luckylifes.blog.csdn.net/article/details/109596040" target="_blank" data-report-click='{"mod":"popu_382","spm":"1001.2101.3001.4136","dest":"https://luckylifes.blog.csdn.net/article/details/109596040","ab":"new"}' data-report-view='{"mod":"popu_382","dest":"https://luckylifes.blog.csdn.net/article/details/109596040","ab":"new"}'>console.log()和console.dir()的区别</a>
            </li>
        </ul>
        <div class="archive-bar"></div>
        <div class="archive-box">
                <div class="archive-title">2020</div> 
                <div class="archive-content">
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/11" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/11"}'>
                        <span class="time">11月</span>
                        <span class="count">5篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/09" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/09"}'>
                        <span class="time">09月</span>
                        <span class="count">4篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/08" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/08"}'>
                        <span class="time">08月</span>
                        <span class="count">27篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/07" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/07"}'>
                        <span class="time">07月</span>
                        <span class="count">26篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/06" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/06"}'>
                        <span class="time">06月</span>
                        <span class="count">54篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/05" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/05"}'>
                        <span class="time">05月</span>
                        <span class="count">29篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/04" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/04"}'>
                        <span class="time">04月</span>
                        <span class="count">22篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://luckylifes.blog.csdn.net/article/month/2020/03" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://luckylifes.blog.csdn.net/article/month/2020/03"}'>
                        <span class="time">03月</span>
                        <span class="count">12篇</span>
                        </a>
                    </div>
                </div>
                <div class="archive-list-item"><a href="https://luckylifes.blog.csdn.net/article/month/2019/11" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":""}'><span class="year">2019年</span><span class="num">156篇</span></a></div>
                <div class="archive-list-item"><a href="https://luckylifes.blog.csdn.net/article/month/2018/12" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":""}'><span class="year">2018年</span><span class="num">2篇</span></a></div>
        </div>
    </div>
</div>
	<div id="footerRightAds" class="isShowFooterAds">
		<div class="aside-box">
			<div id="kp_box_57" data-pid="57"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- PC-博客详情页-左下视窗（300*600） -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="1173711872"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=57&a=2488&c=0&k=&spm=1001.2101.3001.5001&d=1&t=3&u=b7707a8cac534d8c9c66a45a5b71af6b" style="display: block;width: 0px;height: 0px;"></div>
		</div>
	</div>
    <!-- 详情页显示目录 -->
<!--文章目录-->
<div id="asidedirectory" class="aside-box">
    <div class='groupfile' id="directory">
        <h3 class="aside-title">目录</h3>
        <div class="align-items-stretch group_item">
            <div class="pos-box">
            <div class="scroll-box">
                <div class="toc-box"></div>
            </div>
            </div>
        </div>
    </div>
</div>
</aside>
<script>
	$("a.flexible-btn").click(function(){
		$(this).parents('div.aside-box').removeClass('flexible-box');
		$(this).parents("p.text-center").remove();
	})
</script>
<script type="text/javascript"  src="https://g.csdnimg.cn/user-tooltip/2.4/user-tooltip.js"></script>
<script type="text/javascript"  src="https://g.csdnimg.cn/user-medal/1.0.6/user-medal.js"></script>    </div>
<div class="recommend-right  align-items-stretch clearfix" id="rightAside" data-type="recommend">
    <aside class="recommend-right_aside">
        <div id="recommend-right" >
                        <div class='flex-column aside-box groupfile' id="groupfile">
                <div class="groupfile-div">
                <h3 class="aside-title">目录</h3>
                <div class="align-items-stretch group_item">
                    <div class="pos-box">
                        <div class="scroll-box">
                            <div class="toc-box"></div>
                        </div>
                    </div>
                </div>
                </div>
            </div>
                <div id="recommendAdBox">
                    <div id="kp_box_479" data-pid="479"><iframe  src="https://kunpeng-sc.csdnimg.cn/?timestamp=1623163941/#/preview/6672?positionId=479&queryWord=&spm=1001.2101.3001.4834" frameborder="0" width= "300px"  height= "600px" scrolling="no" ></iframe><img class="pre-img-lasy"  data-src="https://kunyu.csdn.net/1.png?p=479&a=3426&c=6672&k=&spm=1001.2101.3001.4834&d=1&t=3&u=95b37d048d4b4ec79b89ceea526b5224" style="display: block;width: 0px;height: 0px;"></div>
                </div>
            <div class='aside-box kind_person d-flex flex-column'>
                    <h3 class="aside-title">分类专栏</h3>
                    <div class="align-items-stretch kindof_item" id="kind_person_column">
                        <div class="aside-content">
                            <ul>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10189881.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10189881.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Python</span>
                                        </span>
                                        <span class="count float-right">54篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9539448.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9539448.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20190927151132530.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">WinForm</span>
                                        </span>
                                        <span class="count float-right">20篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9788368.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9788368.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Java</span>
                                        </span>
                                        <span class="count float-right">13篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10062302.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10062302.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">C#</span>
                                        </span>
                                        <span class="count float-right">51篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9450939.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9450939.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20190927151117521.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">SQL Server</span>
                                        </span>
                                        <span class="count float-right">19篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10266468.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10266468.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Linux</span>
                                        </span>
                                        <span class="count float-right">1篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9994006.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9994006.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">WPF</span>
                                        </span>
                                        <span class="count float-right">15篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_10000971.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_10000971.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/2019092715111047.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">软件安装</span>
                                        </span>
                                        <span class="count float-right">1篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9994158.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9994158.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">MySQL</span>
                                        </span>
                                        <span class="count float-right">4篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8573218.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8573218.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">HTML</span>
                                        </span>
                                        <span class="count float-right">8篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8839213.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8839213.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Css</span>
                                        </span>
                                        <span class="count float-right">13篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8960937.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8960937.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">JavaScript</span>
                                        </span>
                                        <span class="count float-right">93篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9033018.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9033018.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">jQuery</span>
                                        </span>
                                        <span class="count float-right">7篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9221588.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9221588.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Node</span>
                                        </span>
                                        <span class="count float-right">22篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9173916.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9173916.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Ajax</span>
                                        </span>
                                        <span class="count float-right">6篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9173926.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9173926.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">PHP</span>
                                        </span>
                                        <span class="count float-right">5篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9065151.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9065151.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">案例</span>
                                        </span>
                                        <span class="count float-right">31篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8923050.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8923050.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">数据库</span>
                                        </span>
                                        <span class="count float-right">9篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_9131409.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_9131409.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">游戏开发</span>
                                        </span>
                                        <span class="count float-right">2篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/qq_44034384/category_8970492.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/qq_44034384/category_8970492.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">随笔杂文</span>
                                        </span>
                                        <span class="count float-right">2篇</span>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <p class="bottom-text-img">
                        <img class="look-more" src="https://csdnimg.cn/release/blogv2/dist/pc/img/arrowDownWhite.png" alt="">
                    </p>
            </div>
            <div class="recommend-list-box d-flex flex-column aside-box" id="recommend-list-box">
            <ul class="recommend-fixed-box align-items-stretch">
                <li class="right-item">
                    <a href="https://plugin.csdn.net/" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.477675.nonecase\"}","index":"1","strategy":"106_477675_RCMD","dest":"https://plugin.csdn.net/"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.477675.nonecase\"}","index":"1","strategy":"106_477675_RCMD","dest":"https://plugin.csdn.net/"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.477675.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.477675.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>CSDN官方插件，现在体验可获得永久免费去广告特权！</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31560" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-2.nonecase\"}","index":"2","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31560"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-2.nonecase\"}","index":"2","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31560"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-2.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-2.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>Unity游戏开发之贪吃蛇小游戏</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/java_FF/article/details/111867088" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-3.nonecase\"}","index":"3","strategy":"alirec","dest":"https://blog.csdn.net/java_FF/article/details/111867088"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-3.nonecase\"}","index":"3","strategy":"alirec","dest":"https://blog.csdn.net/java_FF/article/details/111867088"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-3.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-3.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>开发规范</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31574" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-4.nonecase\"}","index":"4","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31574"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-4.nonecase\"}","index":"4","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31574"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-4.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-4.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>【拯救者】javaSwing界面速成GUI(含实战)</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/u014377192/13959577" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-5.nonecase\"}","index":"5","strategy":"alirec","dest":"https://download.csdn.net/download/u014377192/13959577"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-5.nonecase\"}","index":"5","strategy":"alirec","dest":"https://download.csdn.net/download/u014377192/13959577"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-5.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-5.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>IDA_Pro_Shortcuts.pdf</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/l346008087/13959603" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-6.nonecase\"}","index":"6","strategy":"alirec","dest":"https://download.csdn.net/download/l346008087/13959603"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-6.nonecase\"}","index":"6","strategy":"alirec","dest":"https://download.csdn.net/download/l346008087/13959603"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-6.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-6.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>广东省广州市DEM数字高程30m（含区域范围shp文件）.zip</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31552" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-7.nonecase\"}","index":"7","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31552"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-7.nonecase\"}","index":"7","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31552"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-7.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-7.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>Power Query For Excel数据处理利器（高级篇）</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_36165389/article/details/111867465" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-8.nonecase\"}","index":"8","strategy":"alirec","dest":"https://blog.csdn.net/qq_36165389/article/details/111867465"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-8.nonecase\"}","index":"8","strategy":"alirec","dest":"https://blog.csdn.net/qq_36165389/article/details/111867465"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-8.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-8.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>Linux服务器批量ssh免密登陆</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/l346008087/13959837" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-9.nonecase\"}","index":"9","strategy":"alirec","dest":"https://download.csdn.net/download/l346008087/13959837"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-9.nonecase\"}","index":"9","strategy":"alirec","dest":"https://download.csdn.net/download/l346008087/13959837"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-9.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-9.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>广东省茂名市DEM数字高程30m（含区域范围shp文件）.zip</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31558" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-10.nonecase\"}","index":"10","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31558"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-10.nonecase\"}","index":"10","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31558"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-10.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-10.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>前端热门技术之新版TypeScript入门学习到案例教程</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/Imane_Qi/article/details/111867374" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-11.nonecase\"}","index":"11","strategy":"alirec","dest":"https://blog.csdn.net/Imane_Qi/article/details/111867374"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-11.nonecase\"}","index":"11","strategy":"alirec","dest":"https://blog.csdn.net/Imane_Qi/article/details/111867374"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-11.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-11.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>C语言：利用指针检查字符串是否是回文</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31554" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-12.nonecase\"}","index":"12","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31554"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-12.nonecase\"}","index":"12","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31554"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-12.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-12.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>SpringCloud技术栈微服务架构天猫商城企业级开发实战(附源码)</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/weixin_45662912/article/details/111867738" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-13.nonecase\"}","index":"13","strategy":"alirec","dest":"https://blog.csdn.net/weixin_45662912/article/details/111867738"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-13.nonecase\"}","index":"13","strategy":"alirec","dest":"https://blog.csdn.net/weixin_45662912/article/details/111867738"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-13.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-13.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>磁盘分区管理</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/tangcv/13960274" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-14.nonecase\"}","index":"14","strategy":"alirec","dest":"https://download.csdn.net/download/tangcv/13960274"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-14.nonecase\"}","index":"14","strategy":"alirec","dest":"https://download.csdn.net/download/tangcv/13960274"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-14.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-14.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>erlang_otp_src_22.3.tar.gz</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_47902348/article/details/111867566" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-15.nonecase\"}","index":"15","strategy":"alirec","dest":"https://blog.csdn.net/qq_47902348/article/details/111867566"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-15.nonecase\"}","index":"15","strategy":"alirec","dest":"https://blog.csdn.net/qq_47902348/article/details/111867566"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-15.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-15.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>计算机网络整理笔记01</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31526" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-16.nonecase\"}","index":"16","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31526"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-16.nonecase\"}","index":"16","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31526"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-16.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-16.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>RPA入门课程之一</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/m0_46267097/13959817" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-17.nonecase\"}","index":"17","strategy":"alirec","dest":"https://download.csdn.net/download/m0_46267097/13959817"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-17.nonecase\"}","index":"17","strategy":"alirec","dest":"https://download.csdn.net/download/m0_46267097/13959817"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-17.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-17.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>nacos-server-1.2.0</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/weixin_47123940/article/details/111867420" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-18.nonecase\"}","index":"18","strategy":"alirec","dest":"https://blog.csdn.net/weixin_47123940/article/details/111867420"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-18.nonecase\"}","index":"18","strategy":"alirec","dest":"https://blog.csdn.net/weixin_47123940/article/details/111867420"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-18.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-18.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>有关等保测评的一些常识整理v1</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31507" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-19.nonecase\"}","index":"19","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31507"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-19.nonecase\"}","index":"19","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31507"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-19.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-19.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>泛型</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/weixin_43824233/article/details/111867538" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-20.nonecase\"}","index":"20","strategy":"alirec","dest":"https://blog.csdn.net/weixin_43824233/article/details/111867538"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-20.nonecase\"}","index":"20","strategy":"alirec","dest":"https://blog.csdn.net/weixin_43824233/article/details/111867538"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-20.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-20.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>买卖股票的最佳时机 IV  java</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_52211156/article/details/111867502" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-21.nonecase\"}","index":"21","strategy":"alirec","dest":"https://blog.csdn.net/qq_52211156/article/details/111867502"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-21.nonecase\"}","index":"21","strategy":"alirec","dest":"https://blog.csdn.net/qq_52211156/article/details/111867502"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-21.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-21.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>将字符串转换成大写 2020.12.28</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/x_u_xiang/article/details/111866858" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-22.nonecase\"}","index":"22","strategy":"alirec","dest":"https://blog.csdn.net/x_u_xiang/article/details/111866858"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-22.nonecase\"}","index":"22","strategy":"alirec","dest":"https://blog.csdn.net/x_u_xiang/article/details/111866858"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-22.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-22.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>抽象类和接口的区别</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/dong_ge2014/article/details/111867526" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-23.nonecase\"}","index":"23","strategy":"alirec","dest":"https://blog.csdn.net/dong_ge2014/article/details/111867526"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-23.nonecase\"}","index":"23","strategy":"alirec","dest":"https://blog.csdn.net/dong_ge2014/article/details/111867526"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-23.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-23.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>面试题： 数据库：delete和trancate删除表记录的区别</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/combo/detail/1989" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-24.nonecase\"}","index":"24","strategy":"alirec","dest":"https://edu.csdn.net/combo/detail/1989"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-24.nonecase\"}","index":"24","strategy":"alirec","dest":"https://edu.csdn.net/combo/detail/1989"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-24.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-24.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>javaweb高薪就业课程</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/24085" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-25.nonecase\"}","index":"25","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/24085"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-25.nonecase\"}","index":"25","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/24085"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-25.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-25.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>青少年编程等级考试-Scratch图形化1级</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_32625545/article/details/111867640" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-26.nonecase\"}","index":"26","strategy":"alirec","dest":"https://blog.csdn.net/qq_32625545/article/details/111867640"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-26.nonecase\"}","index":"26","strategy":"alirec","dest":"https://blog.csdn.net/qq_32625545/article/details/111867640"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-26.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-26.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>golang并发</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_46175823/article/details/111867590" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-27.nonecase\"}","index":"27","strategy":"alirec","dest":"https://blog.csdn.net/qq_46175823/article/details/111867590"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-27.nonecase\"}","index":"27","strategy":"alirec","dest":"https://blog.csdn.net/qq_46175823/article/details/111867590"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-27.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-27.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>Linux 从入门到跑路第二十一讲 -- 字符串截取</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31561" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-28.nonecase\"}","index":"28","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31561"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-28.nonecase\"}","index":"28","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31561"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-28.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-28.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>机器学习实战(直播时间：1月11日---1月23日)</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31565" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-29.nonecase\"}","index":"29","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31565"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-29.nonecase\"}","index":"29","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31565"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-29.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-29.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>C&amp;C++面试题视频讲解</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31533" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-30.nonecase\"}","index":"30","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31533"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-30.nonecase\"}","index":"30","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31533"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-30.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-30.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>移动端自动化测试Appium实战-基于Java语言-提供源码</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/EtoneGroup/13960198" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-31.nonecase\"}","index":"31","strategy":"alirec","dest":"https://download.csdn.net/download/EtoneGroup/13960198"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-31.nonecase\"}","index":"31","strategy":"alirec","dest":"https://download.csdn.net/download/EtoneGroup/13960198"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-31.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-31.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>零壹智库-网约车攻防战-202006-19页.pdf</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_40835969/article/details/111866002" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-32.nonecase\"}","index":"32","strategy":"alirec","dest":"https://blog.csdn.net/qq_40835969/article/details/111866002"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-32.nonecase\"}","index":"32","strategy":"alirec","dest":"https://blog.csdn.net/qq_40835969/article/details/111866002"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-32.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-32.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>mybatis报错解决</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/Sixgodking/article/details/111844558" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-33.nonecase\"}","index":"33","strategy":"alirec","dest":"https://blog.csdn.net/Sixgodking/article/details/111844558"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-33.nonecase\"}","index":"33","strategy":"alirec","dest":"https://blog.csdn.net/Sixgodking/article/details/111844558"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-33.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-33.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>C++建造者模式（以英雄属性为例）</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/jore_01/13960807" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-34.nonecase\"}","index":"34","strategy":"alirec","dest":"https://download.csdn.net/download/jore_01/13960807"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-34.nonecase\"}","index":"34","strategy":"alirec","dest":"https://download.csdn.net/download/jore_01/13960807"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-34.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-34.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>PCAL6416A扩展芯片</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31542" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-35.nonecase\"}","index":"35","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31542"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-35.nonecase\"}","index":"35","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31542"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-35.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-35.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>2020年末最新微信小程序云开发入门(6小时带你微信小程序云开发入门)</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_45534034/article/details/111867480" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-36.nonecase\"}","index":"36","strategy":"alirec","dest":"https://blog.csdn.net/qq_45534034/article/details/111867480"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-36.nonecase\"}","index":"36","strategy":"alirec","dest":"https://blog.csdn.net/qq_45534034/article/details/111867480"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-36.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-36.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>[Linux] git add时的注意事项</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31529" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-37.nonecase\"}","index":"37","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31529"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-37.nonecase\"}","index":"37","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31529"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-37.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-37.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>【数据分析实战训练营】SPSS调查问卷统计分析</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://edu.csdn.net/course/detail/31555" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-38.nonecase\"}","index":"38","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31555"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-38.nonecase\"}","index":"38","strategy":"alirec","dest":"https://edu.csdn.net/course/detail/31555"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-38.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-edu_course-alirec-38.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>Python基础与数据分析(直播时间：12月28日---12月31日)</h5>
                            </div>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://download.csdn.net/download/weixin_44711745/13960418" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-39.nonecase\"}","index":"39","strategy":"alirec","dest":"https://download.csdn.net/download/weixin_44711745/13960418"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-download-alirec-39.nonecase\"}","index":"39","strategy":"alirec","dest":"https://download.csdn.net/download/weixin_44711745/13960418"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-download-alirec-39.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-download-alirec-39.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>四阶段第5天资料.zip</h5>
                            </div>
                            <span class="download_mark_button ">立即下载 </span>
                        </div>
                    </a>
                </li> 
                <li class="right-item">
                    <a href="https://blog.csdn.net/qq_36412526/article/details/111867555" target="_blank"  data-report-view='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-40.nonecase\"}","index":"40","strategy":"alirec","dest":"https://blog.csdn.net/qq_36412526/article/details/111867555"}'  data-report-click='{"ab":"new","mod":"popu_858","extra":"{\"utm_medium\":\"distribute.pc_blog_right_sidebar.none-task-blog-alirec-40.nonecase\"}","index":"40","strategy":"alirec","dest":"https://blog.csdn.net/qq_36412526/article/details/111867555"}'  data-report-query='utm_medium=distribute.pc_blog_right_sidebar.none-task-blog-alirec-40.nonecase&depth_1-utm_source=distribute.pc_blog_right_sidebar.none-task-blog-alirec-40.nonecase'>
                        <div class="context-box ">
                            <div class="content clearfix ">
                                <h5>Linux sync命令</h5>
                            </div>
                        </div>
                    </a>
                </li> 
            </ul>
            </div>
        </div>
    </aside>
</div>

</div>
<div class="mask-dark"></div>
<script type="text/javascript">
    var timert = setInterval(function(){
      sideToolbar = $(".csdn-side-toolbar");
      if (sideToolbar.length > 0) {
        sideToolbar.css('cssText','bottom:64px !important;')
        clearInterval(timert);
      }
    }, 200);
</script>
<script>
    var articleId = 107044216;
    var commentscount = 51;
    var curentUrl = "https://blog.csdn.net/qq_44034384/article/details/107044216";
    var myUrl = "https://my.csdn.net/";
    var highlight = ["深入浅出","Python","Python","基础","语法","全解"];//高亮数组
    var share_card_url = "https://blog.csdn.net/qq_44034384/article/shareArticleCardPage?article_id=107044216"
	var articleType = 1;
    var baiduKey = "深入浅出python";
    var needInsertBaidu = true;
    var recommendRegularDomainArr = ["blog.csdn.net/.+/article/details/","download.csdn.net/download/","edu.csdn.net/course/detail/","ask.csdn.net/questions/","bbs.csdn.net/topics/","www.csdn.net/gather_.+/"]
    var codeStyle = "atom-one-light";
    var baiduSearchType = "utm_term";
    var canRead = true;
    var blogMoveHomeArticle = false;
    var showPcWindowAd = false;
    var linkPage = true;
</script>
<script src="https://csdnimg.cn/public/sandalstrap/1.4/js/sandalstrap.min.js"></script>
<div class="skin-boxshadow"></div>
<div style="display:none;">
	<img src="" onerror='setTimeout(function(){if(!/(csdn.net|iteye.com|baiducontent.com|googleusercontent.com|360webcache.com|sogoucdn.com|bingj.com|baidu.com)$/.test(window.location.hostname)){window.location.href="\x68\x74\x74\x70\x73\x3a\x2f\x2f\x77\x77\x77\x2e\x63\x73\x64\x6e\x2e\x6e\x65\x74"}},3000);'>
</div>
</body>
<script src="https://csdnimg.cn/release/blogv2/dist/components/js/pc_wap_highlight-db1e81323a.min.js" type="text/javascript"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/components/js/pc_wap_common-906586e915.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://csdnimg.cn/release/blog_editor_html/release1.6.12/ckeditor/plugins/codesnippet/lib/highlight/styles/atom-one-light.css">
<script>
 // 全局声明
 if (window.csdn === undefined) {
      window.csdn = {};
    }
    window.csdn.sideToolbar = {
        options: {
            report:{
                isShow: true,
            },
            qr: {
                isShow: false,
            },
            guide: {
                isShow: true
            }
        }
    }
    $(function(){
        $(document).on('click',"a.option-box[data-type='report']",function() {
            window.csdn.userLogin.loadAjax(function(res){
                showReport(false,articleTitles);
            })
        });
    })
</script>
    <script src="https://g.csdnimg.cn/baidu-search/1.0.9/baidu-search.js"  type="text/javascript"></script>
<script src="https://csdnimg.cn/release/download/old_static/js/qrcode.js"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/pc/js/common-b286f966c8.min.js" type="text/javascript"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/pc/js/detail-d9a4c4b737.min.js" type="text/javascript"></script>
<script src="https://g.csdnimg.cn/user-ordercart/1.0.6/user-ordercart.js" type="text/javascript"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/pc/js/column-78261cfea6.min.js" type="text/javascript"></script>
<script src="https://g.csdnimg.cn/side-toolbar/2.8/side-toolbar.js" type="text/javascript"></script>
<script src="https://g.csdnimg.cn/copyright/1.0.3/copyright.js" type="text/javascript"></script>
<script>
    $(".MathJax").remove();
    if ($('div.markdown_views pre.prettyprint code.hljs').length > 0) {
        $('div.markdown_views')[0].className = 'markdown_views';
    }
</script>
<script type="text/javascript" src="https://csdnimg.cn/release/blog_mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
            "HTML-CSS": {
                    linebreaks: { automatic: true, width: "94%container" },
                    imageFont: null
            },
            tex2jax: {
                preview: "none"
            },
            mml2jax: {
                preview: 'none'
            }
    });
</script>
<script type="text/javascript" crossorigin src="https://g.csdnimg.cn/user-login/2.3.2/user-login.js"></script>
<script type="text/javascript" crossorigin src="https://g.csdnimg.cn/login-box/1.1.4/login-box.js"></script></html>
